Skip to content

Instantly share code, notes, and snippets.

@gitawego
Created June 4, 2015 10:34
Show Gist options
  • Select an option

  • Save gitawego/a3df866231c1fc3d7237 to your computer and use it in GitHub Desktop.

Select an option

Save gitawego/a3df866231c1fc3d7237 to your computer and use it in GitHub Desktop.
nginx config for websocket
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream websocket {
server 192.168.100.10:8010;
}
server {
listen 8020;
location / {
proxy_pass http://websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
@gitawego

gitawego commented Jun 4, 2015

Copy link
Copy Markdown
Author

need nginx >= 1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment