Skip to content

Instantly share code, notes, and snippets.

@kkeybbs
Created April 11, 2017 00:22
Show Gist options
  • Save kkeybbs/e5f19e96856db34b48c3776296537428 to your computer and use it in GitHub Desktop.
Save kkeybbs/e5f19e96856db34b48c3776296537428 to your computer and use it in GitHub Desktop.
nginx websocket proxy
location /publish/dev/app/ws {
proxy_pass http://test:80;
# include conf.d/ws.txt;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass_request_headers on;
proxy_pass_header Server;
real_ip_header X-Real-IP;
# proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Scheme $scheme;
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