我的NodeJS学习之路(实践之路)

NodeJS部署Socket.io出现错误wss handsha

2018-06-21  本文已影响6人  Devid

查了一下官网才发现原来在配置反向代理的时候,如果需要使用wss,还需要加上如下配置:

location /wsapp/ {
    proxy_pass http://wsbackend;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
}

官网链接:https://www.nginx.com/blog/websocket-nginx/

上一篇 下一篇

猜你喜欢

热点阅读