在本地调试中是正常的。配置到服务器中,有nginx反向代理,会出现websocket 400错误

nginx 配置websocket 400 问题

chunk-vendors.dd3a3558.js:1 WebSocket connection to 'ws://192.168.111.20:8074/endpointChat/313/rvcnhy5n/websocket' failed: Error during WebSocket handshake: Unexpected response code: 400

 

需要nginx中配置 :

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

相关文章:

  • 2021-04-17
  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-23
  • 2022-12-23
  • 2022-01-26
  • 2021-11-15
  • 2022-01-26
  • 2021-08-06
相关资源
相似解决方案