更新时间:2023-11-22 18:58:40
您的nginx
配置将/websocket/
以下的请求与结尾的/
进行匹配.这是/websocket/blah
的目录组件.
Your nginx
config is matching requests below /websocket/
with the trailing /
. That is the directory component of /websocket/blah
.
如果您查看nginx
访问日志文件,则会发现您对/websocket
的请求正被301重定向到/websocket/
.
If you look in your nginx
access log file you'll find your requests to /websocket
are being 301 redirected to /websocket/
.
删除尾随的/
location /websocket {
proxy_pass http://localhost:3001/websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}