WebSocket握手期间出现HTTPS错误的操作电缆:意外的响应代码:404

时间:2016-12-18 13:25:28

标签: ruby-on-rails nginx https elastic-beanstalk actioncable

它适用于http,但升级到https时会发生此错误。

这是我的环境:

  • AWS Elastic Beanstalk
  • 运行Ruby 2.3(Puma)的64位Amazon Linux 2016.09 v2.2.0
  • ActionCable

配置:

    location /cable {
            proxy_pass http://my_app;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "Upgrade";
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-Proto https;
          }

从服务器登录:

    [2016-12-18T13:07:48.252727 #19764]  INFO -- : [4d1c9c93-2724-48c6-8b7c-4e42beae94c7] Started GET "/cable" for 162.158.166.199 at 2016-12-18 13:07:48 +0000    
    [2016-12-18T13:07:48.254025 #19764]  INFO -- : [4d1c9c93-2724-48c6-8b7c-4e42beae94c7] Started GET "/cable/"[non-WebSocket] for 162.158.166.199 at 2016-12-18 13:07:48 +0000
    [2016-12-18T13:07:48.254084 #19764] ERROR -- : [4d1c9c93-2724-48c6-8b7c-4e42beae94c7] Failed to upgrade to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: )
    [2016-12-18T13:07:48.254146 #19764]  INFO -- : [4d1c9c93-2724-48c6-8b7c-4e42beae94c7] Finished "/cable/"[non-WebSocket] for 162.158.166.199 at 2016-12-18 13:07:48 +0000

我非常感谢你的帮助。

感谢。

0 个答案:

没有答案