diff --git a/Running-changedetection.io-behind-a-reverse-proxy-sub-directory.md b/Running-changedetection.io-behind-a-reverse-proxy.md similarity index 71% rename from Running-changedetection.io-behind-a-reverse-proxy-sub-directory.md rename to Running-changedetection.io-behind-a-reverse-proxy.md index 0d5d1fa..3506b41 100644 --- a/Running-changedetection.io-behind-a-reverse-proxy-sub-directory.md +++ b/Running-changedetection.io-behind-a-reverse-proxy.md @@ -1,19 +1,9 @@ -You need to enable the `USE_X_SETTINGS` environment variable in the application for it to respect the headers sent from nginx +You need to enable the `USE_X_SETTINGS` environment variable in changedetection.io for it to respect HTTP headers sent from the reverse proxy (such as `Host`, `X-Forwarded-Prefix` and `X-Forwarded-Proto`). -Without this, the application will not listen to the following variables +The easiest way is to create an extra docker-compose YML file and run it with the shipped version. +Create a `docker-compose.nginx.yml` (`expose` may not be what you want, but up to you): -``` - proxy_set_header Host "localhost"; - proxy_set_header X-Forwarded-Prefix /app; - proxy_set_header X-Forwarded-Proto $scheme; -``` - -Easiest example is to create an extra docker-compose YML file and run it with the shipped version - -Create a `docker-compose.nginx.yml`, `expose` may not be what you want, but up to you. - - -``` +```yaml version: '2' services: changedetection.io: @@ -40,9 +30,9 @@ networks: changenet: ``` -## NGINX +## NGINX Reverse Proxy -And an example `nginx.conf` +And an example `nginx.conf` which hosts changedetection on the subdirectory `/app`: ``` server { @@ -58,7 +48,7 @@ server { } ``` -*Note the trailing `'/'` on the location line. This is needed to display some css elements correctly.* +When using a subdirectory, it's important to have a trailing `'/'` on the location line. Otherwise, static CSS and JS content will not load properly. The trailing slash is not needed when hosting changedetection.io on a subdomain. Then simply @@ -78,7 +68,7 @@ _Note_: You may like to comment out the `ports:` section of the base `docker-com ``` -## Caddy Server Reverse Proxy +## Caddy Reverse Proxy In Caddy alternately, you just need to configure the X-Forwarded-Prefix.