无限星辰工作室-客户无限互联网动力之源
标题:
Nginx反代理Websocket配置例子
[打印本页]
作者:
crx349
时间:
2020-10-20 23:30
标题:
Nginx反代理Websocket配置例子
upstream ws_svr {
server 127.0.0.1:6688 weight=1;
}
server {
listen 8899;
server_name 127.0.0.1;
location / {
#proxy_redirect off;
proxy_pass http://ws_svr;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
#proxy_set_header Origin "";
}
}
复制代码
说明:流程是nginx的8899端口反代理6688的ws端口,客户端链接可以直接ws://127.0.0.1:8899
欢迎光临 无限星辰工作室-客户无限互联网动力之源 (https://xmspace.net/)
Powered by Discuz! X3.4