我在Localhost上运行我的应用程序,但是当我尝试通过Websocket通过nginx连接时,它以400响应我。但是当我直接访问API端口时,它正常工作

问题描述 投票:0回答:0

这里是我的nginxconfig

events { worker_connections 16384; } http { access_log off; sendfile on; upstream eventos { server localhost:3001; server localhost:3002; } server { listen 9999; location / { proxy_pass http://eventos; } location /websocket { proxy_pass http://eventos; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } } postman示例

通过nginx进行了反对:


通过直接访问来核心:

我的问题是在邮递员中。 出于某种原因,我有两个授权标题,一个具有正确的价值,另一个为空。 Failed through NGINX在这里如何 当我发送带有双授权标头的请求到Nginx时,它返回了400响应。

IT仅发生在Websocket集合中,HTTP Collections与Double auth标头一起运行良好,这可能是因为Postman覆盖了默认一个。也许对于WebSocket的收藏率也不相同?

Success through direct access

node.js docker nginx websocket express-ws
最新问题
© www.soinside.com 2019 - 2024. All rights reserved.