挫娃子

Nginx反向代理Websocket

upstream frontends {
server 127.0.0.1:4702;
}
server {
server_name www.abc.com;
location / {
proxy_pass http://frontends;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “upgrade”;
}
}

且行且珍惜,转载请注明来自挫娃子《Nginx反向代理Websocket》

评论