Skip to content

Instantly share code, notes, and snippets.

@luxwarp
Last active August 22, 2019 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luxwarp/ba2fb7065c2e57719b5b868f31c13fb6 to your computer and use it in GitHub Desktop.
Save luxwarp/ba2fb7065c2e57719b5b868f31c13fb6 to your computer and use it in GitHub Desktop.
A typical Nginx server block for Webmin.
# A typical Nginx server block for Webmin.
# This asumes that you have disabled ssl in webmin miniserv.conf and added
# referer=manage.example.com in webmin conf file.
# Author: Mikael Luxwarp Carlsson luxwarp@codeiolo.org https://codeiolo.org
# License: ISC
# Created: 2019-08-22
server {
# Ports to listen to.
listen 80;
listen [::]:80;
# Server name to listen for.
server_name manage.example.com;
# Proxy down traffic to running webmin server.
location / {
# set some headers and proxy stuff.
proxy_pass http://localhost:10000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# include Host header
proxy_set_header Host $http_host;
# Fixes initial redirect after login
proxy_redirect http://$host:10000/ https://$http_host/;
}
# Where to store logs for nginx traffic.
access_log /var/log/nginx/manage.example.com.access.log;
error_log /var/log/nginx/manage.example.com.error.log;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment