Last active
August 22, 2019 15:50
-
-
Save luxwarp/ba2fb7065c2e57719b5b868f31c13fb6 to your computer and use it in GitHub Desktop.
A typical Nginx server block 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
# 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