本帖最后由 阿斯蒂芬 于 2024-5-13 11:34 编辑
如果是nginx代理的话,这种是websocket没有代理的原因
解决方案参考:
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:10012;
}
核心点是添加下面这两行
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
|