Updated Reverse proxy to the Glances Web UI (markdown)

Nicolas Hennion 2016-11-05 16:09:18 +01:00
parent ee57bf7cec
commit 05e9bf71ad

@ -26,20 +26,19 @@
proxy_set_header X-Forwarded-Proto $scheme;
}
or:
`location /glances/ {`
`rewrite /glances/(.*) / break;`
`proxy_pass http://localhost:61208;`
`proxy_set_header Host $host;`
`proxy_set_header X-Real-IP $remote_addr;`
`proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;`
`proxy_set_header X-Forwarded-Proto $scheme; #doesn't do anything?`
`}`
`location / {`
`if ($http_referer ~ "^https?://[^/]+/glances"){`
`rewrite ^/(.*) https://$http_host/glances/ redirect;`
`}`
`}`
or (thanks to @gavinws in https://github.com/nicolargo/glances/issues/876):
location /glances/ {
rewrite /glances/(.*) /$1 break;
proxy_pass http://localhost:61208;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; #doesn't do anything?
}
location / {
if ($http_referer ~ "^https?://[^/]+/glances"){
rewrite ^/(.*) https://$http_host/glances/$1 redirect;
}
}