Skip to content

Instantly share code, notes, and snippets.

@taka-wang
Created April 19, 2014 14:08
Show Gist options
  • Save taka-wang/11085396 to your computer and use it in GitHub Desktop.
Save taka-wang/11085396 to your computer and use it in GitHub Desktop.
nginx to reverse proxy websockets
upstream my_websocket {
server localhost:443;
}
server {
listen 444;
server_name _;
location / {
proxy_pass http://my_websocket ;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_read_timeout 86400; // default 60 secs
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment