Where can I put custom nginx conf that won't be overwritten?
-
@robi I haven't tried that because I'm not sure where to put it in order to have it overwrite the default Cloudron configs. Any suggestions on that? Thanks!
@kaxline I think to properly support this, we can look into this for the next release. For the moment, I am still perplexed why those nginx configs are being overwritten everyday. I am not able to reproduce this here atleast.
Can you please try this:
- Edit some random nginx config file
- Add a dummy comment
- Can you report back tomorrow if that comment is still there? Or did it disappear?
-
@robi I haven't tried that because I'm not sure where to put it in order to have it overwrite the default Cloudron configs. Any suggestions on that? Thanks!
-
Rather than trying to get Docker to do something it isn't usually tasked with doing (or perhaps within the Cloudron system), do these posts offer a possible alternative?:
https://cloak.ist/blog/how-to-put-a-ghost-blog-at-a-subdirectory-using-cloudflare-workers/
-
@kaxline I think to properly support this, we can look into this for the next release. For the moment, I am still perplexed why those nginx configs are being overwritten everyday. I am not able to reproduce this here atleast.
Can you please try this:
- Edit some random nginx config file
- Add a dummy comment
- Can you report back tomorrow if that comment is still there? Or did it disappear?
@girish OK, I chose a couple of the other app configs and added a comment. They were overwritten along with the Ghost config I originally was asking about. Any thoughts? Anything significant about the 5am/5pm PT time? Want me to test anything else? Send you some logs?
-
Rather than trying to get Docker to do something it isn't usually tasked with doing (or perhaps within the Cloudron system), do these posts offer a possible alternative?:
https://cloak.ist/blog/how-to-put-a-ghost-blog-at-a-subdirectory-using-cloudflare-workers/
@scooke Yes! Thank you! I was looking at how to do this with Cloudflare right off the bat but couldn't find how to do it. Working now!
I would say this is less about Docker and more about Nginx. It would be nice to easily route subdirectory paths to different Cloudron apps via Nginx. Maybe in the UI there's a way to add a directory path in the Location panel.
Thanks again!
-
@girish OK, I chose a couple of the other app configs and added a comment. They were overwritten along with the Ghost config I originally was asking about. Any thoughts? Anything significant about the 5am/5pm PT time? Want me to test anything else? Send you some logs?
-
One can use the
include /path/...;
command for additional appX.conf filesI believe, you could use this configuration:
server { server_name example.com; listen [::]:80; listen 80; include /path/to/applications/*/nginx.conf; }
and then in each application's directory configure the redirection like this:
location /app1 { proxy_pass http://app1; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Request-Start $msec; }
-
@scooke Yes! Thank you! I was looking at how to do this with Cloudflare right off the bat but couldn't find how to do it. Working now!
I would say this is less about Docker and more about Nginx. It would be nice to easily route subdirectory paths to different Cloudron apps via Nginx. Maybe in the UI there's a way to add a directory path in the Location panel.
Thanks again!
@kaxline I found the issue! Can you please try this one-liner - https://git.cloudron.io/cloudron/box/-/commit/6839ff4cf60cb725d224619ee55bcf066a496a12 . The file to edit is
/home/yellowtent/box/src/reverseproxy.js
. After that, the nginx configs will not get overwritten everyday. -
@kaxline I found the issue! Can you please try this one-liner - https://git.cloudron.io/cloudron/box/-/commit/6839ff4cf60cb725d224619ee55bcf066a496a12 . The file to edit is
/home/yellowtent/box/src/reverseproxy.js
. After that, the nginx configs will not get overwritten everyday. -
@girish I ended up going with a Cloudflare script, which feels a little cleaner for now. I'll try this when I revisit the issue. Thanks for all your help!
-
G girish has marked this topic as solved on
-
-
@kaxline can you kindly share your script?
We have other Cloudflare users here who may benefit from your experience.
-
K kaxline referenced this topic on
-
-