Skip to content

Instantly share code, notes, and snippets.

@jirfag
Created April 27, 2016 17:16
Show Gist options
  • Save jirfag/ed8a1a6514c0ff5483dc30a5333f73eb to your computer and use it in GitHub Desktop.
Save jirfag/ed8a1a6514c0ff5483dc30a5333f73eb to your computer and use it in GitHub Desktop.
Nginx websockets config
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name ws.disaev.ru;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_pass http://127.0.0.1:8001;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment