Add reverse proxy config for automatic HTTP/HTTPS handling

Avi
2017-10-07 02:45:30 -05:00
parent aae444f181
commit 6babfc1971

@@ -132,6 +132,25 @@ proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Ssl on;
```
As an alternative, the following configuration will automatically work for both HTTP and HTTPS.
```
location /plexpy/ {
proxy_pass http://127.0.0.1:8181;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 90;
proxy_set_header X-Forwarded-Proto $scheme;
set $xforwardedssl "off";
if ($scheme = https) {
set $xforwardedssl "on";
}
proxy_set_header X-Forwarded-Ssl $xforwardedssl;
proxy_redirect ~^(http(?:s)?://)([^:]+)(?::\d+)?(/.*)?$ $1$2:$server_port$3;
}
```
Don't forget to clear your web browser's cache *every* time you update your web server configuration.
#### <a name="general-q11">Q:</a> I need to reinstall PlexPy. Can I keep my history and statistics?