upstream wss {
# 这里的localhost是映射本地服务器,也可以是外网ip,8282是我ws开启的端口。
server 127.0.0.1:8282;
}
location /wss {
proxy_pass http://wss;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_connect_timeout 60s;
proxy_read_timeout 300s;#读超时时间
proxy_send_timeout 300s;#写超时时间
} |
upstream wss {
# 这里的localhost是映射本地服务器,也可以是外网ip,8282是我ws开启的端口。
server 127.0.0.1:8282;
}
location /wss {
proxy_pass http://wss;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_connect_timeout 60s;
proxy_read_timeout 300s;#读超时时间
proxy_send_timeout 300s;#写超时时间
}