使用 socket.io + nginx 时,出现 400 错误,无法通信

解决方法

将下面的代码配置到 nginx 的配置文件中

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

猜你喜欢

转载自www.cnblogs.com/StarUDream/p/9045442.html