Created
December 30, 2016 00:38
-
-
Save haarcuba/ae27bbfdf3e13c90e85ff9e45a5b7097 to your computer and use it in GitHub Desktop.
nginx reverse proxy
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
include mime.types; | |
upstream NAME_OF_SERVICE { | |
server localhost:1905; | |
} | |
server { | |
listen 80; | |
rewrite ^(.*) https://$host$1 permanent; | |
} | |
server { | |
listen 443 ssl; | |
server_name WWW.YOUR-DOMAIN.COM; | |
ssl_certificate /path/to/cert.pem; | |
ssl_certificate_key /path/to/privkey.pem; | |
location / { | |
proxy_pass http://NAME_OF_SERVICE; # match the name of upstream directive which is defined above | |
proxy_buffering off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment