【问题标题】:nginx websocket handshake error 400 Useing AWS ELBnginx websocket握手错误400使用AWS ELB
【发布时间】:2020-03-06 18:36:20
【问题描述】:

我使用 Rockect 聊天。

失败:Websocket 握手期间出错:意外响应代码:400

我的设置。 我在 AWS EC2 服务器上的 Ubuntu 上将 Rocketchat 作为 sanp 安装。
https --> 负载均衡器 -------> nginx -----> Rocketchat

Nginx 设置

# Upstreams

upstream backend {

    server 127.0.0.1:3000;

}



server {

    listen 80;

    server_name allthatsneakers.com;

    location / {

     proxy_pass http://backend/;

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

     proxy_set_header Host $http_host;
     proxy_set_header X-Real-IP $remote_addr;
     proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
     proxy_set_header X-Forward-Proto http;
     proxy_set_header X-Nginx-Proxy true;

     proxy_redirect off;

    }

}

谢谢。

【问题讨论】:

    标签: nginx websocket


    【解决方案1】:

    这是套接字错误。

    Https -> TCP(HTTPS)

    固定。

    【讨论】:

      猜你喜欢
      • 2013-06-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多