Skip to content

Instantly share code, notes, and snippets.

@haarcuba
Created December 30, 2016 00:38
Show Gist options
  • Save haarcuba/ae27bbfdf3e13c90e85ff9e45a5b7097 to your computer and use it in GitHub Desktop.
Save haarcuba/ae27bbfdf3e13c90e85ff9e45a5b7097 to your computer and use it in GitHub Desktop.
nginx reverse proxy
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