Last active
March 11, 2018 16:46
-
-
Save highgain86j/eb289439b74840c798227ff3a3b016b2 to your computer and use it in GitHub Desktop.
Reverse-proxying for Webmin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
server_name some_hostname; | |
#location / { | |
#location /webmin/ { | |
location / { | |
# Tell nginx that we want to proxy everything here to the local webmin server | |
# Last slash is important | |
proxy_pass http://127.0.0.1:10000/; | |
# Change the response Location: header to come from our proxy directory, not the server | |
# Fixes initial redirect after login | |
#proxy_redirect http://$host:10000/ /webmin/; | |
proxy_redirect http://$host:10000/ /; | |
# Also fixes initial redirect after login | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Host $host; | |
proxy_set_header X-Forwarded-Server $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
} | |
#} | |
#} | |
} | |
# Proxy for webmin | |
# Last slash is important | |
#https://serverfault.com/questions/443482/proxying-webmin-with-nginx | |
# | |
#/etc/webmin/config | |
#webprefixnoredir=1 | |
#referers=10.2.255.200 | |
# | |
#/etc/webmin/config (optional) | |
#webprefix=/webmin | |
# | |
#/etc/webmin/miniserv.conf | |
#bind=127.0.0.1 | |
#sockets= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment