1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| upstream wss_svr { server 127.0.0.1:8080; }
map $http_upgrade $connection_upgrade { default keep-alive; 'websocket' upgrade; }
server { listen 80; server_name aaa.bbb.ccc;
location / { proxy_http_version 1.1; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real_IP $remote_addr; proxy_pass http://wss_svr; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_set_header REMOTE-HOST $remote_addr; proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for; } }
|