1. 程式人生 > >使用 socket.io + nginx 時,出現 400 錯誤,無法通信

使用 socket.io + nginx 時,出現 400 錯誤,無法通信

nginx TP 配置文件 pro ket 解決方法 pre sock 通信

解決方法

將下面的代碼配置到 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 錯誤,無法通信