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

Posted starudream

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用 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";
}

以上是关于使用 socket.io + nginx 时,出现 400 错误,无法通信的主要内容,如果未能解决你的问题,请参考以下文章