diff --git a/Setup-Reverse-Proxy.md b/Setup-Reverse-Proxy.md index 456085c..dfc55f3 100644 --- a/Setup-Reverse-Proxy.md +++ b/Setup-Reverse-Proxy.md @@ -41,8 +41,30 @@ http { } } ``` -If you want to use nginx as proxy for subdomain just replace the `/calibre` in the location line with `/` and remove the `X-Script-Name` line. Do not change anything else and it will work. +If you want to use nginx as proxy for subdomain (or domain) just replace the `/calibre` in the location line with `/` and remove the `X-Script-Name` line. Do not change anything else and it will work. The `X-Scheme` directive is used to preserve the protocol (http/https), it could be hard coded to `http` or `https` to force this type of protocol.\ + +##### E.g + +`sudo nano /etc/nginx/sites-enabled/calibre` + +``` +server { + listen 80; + server_name subdomain.example.com; + client_max_body_size 20M; + + location / { # Reduced to "/" + proxy_bind $server_addr; + proxy_pass http://127.0.0.1:8083; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Scheme $scheme; + # Removed proxy_set_header + } + } +``` + *Note: If using SSL in your reverse proxy on a non-standard port (e.g.12345), the following proxy_redirect line may be required:* ``` proxy_redirect http://$host/ https://$host:12345/;