zoukankan      html  css  js  c++  java
  • SingR 部署后显示:WebSocket connection to failed: Error during WebSocket handshake: Unexpected response code: 200

    部署到Linux后,出现问题:

    WebSocket connection to failed: Error during WebSocket handshake: Unexpected response code: 200

    原因是服务器使用Nginx不支持websocket,但Nginx可用代理Websocket连接,需要做如下配置:

    location / {
    proxy_pass http://backend;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    }
    

      

    但我们修改后会出现问题,我么之前正常的请求,都变成了400 Bad Request

    我们想方法变通下,独立出SingR的请求配置

    location / {
      proxy_pass http://backend;
      proxy_http_version 1.1;
    }

    location /chatHub {
      proxy_pass http://backend;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
    }

      

    这样就可用了。

  • 相关阅读:
    vlc-ts
    es 模板
    zookeeper 启动脚本
    received shard failed for shard id
    gitlab runner 配置
    kafka 配置文件注释
    logstash 统计告警
    BigBao 的python开发到DevOps 之路
    logstash 自动重新加载配置
    rsyslog 传输日志
  • 原文地址:https://www.cnblogs.com/saving/p/11220970.html
Copyright © 2011-2022 走看看