Skip to content

Instantly share code, notes, and snippets.

@robhammond
Created December 16, 2016 11:58
Show Gist options
  • Save robhammond/e7edf8dfb1e68914ea23cb478296f254 to your computer and use it in GitHub Desktop.
Save robhammond/e7edf8dfb1e68914ea23cb478296f254 to your computer and use it in GitHub Desktop.
upstream myapp {
server 127.0.0.1:8082;
}
server {
listen 80;
server_name example.com;
location / {
proxy_set_header X-Request-Base https://$host/myapp;
rewrite ^/myapp/?(.*)$ /$1 break;
proxy_pass http://myapp;
proxy_read_timeout 300;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-HTTPS 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment