yisier / nps

在 0.26.10 版本的基础上修改而来的
https://ehang.io/nps/documents
GNU General Public License v3.0
1.95k stars 245 forks source link

Websocket 前置Nginx或者Cloudflare之后报错误400 #51

Closed 5high closed 1 year ago

5high commented 1 year ago

如果前置了Cloudflare或者Nginx的proxy_pass , websocket 会报错误400。

能否指点一下问题出在哪里?

yisier commented 1 year ago

nignx 反向代理 ws,一般需要配置:

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";