Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/59.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Rails ActionCable生产上的帧标头无效_Ruby On Rails_Amazon Web Services_Nginx_Puma_Actioncable - Fatal编程技术网

Ruby on rails Rails ActionCable生产上的帧标头无效

Ruby on rails Rails ActionCable生产上的帧标头无效,ruby-on-rails,amazon-web-services,nginx,puma,actioncable,Ruby On Rails,Amazon Web Services,Nginx,Puma,Actioncable,我有一个actioncable应用程序,在开发时可以正常工作,但在Amazon Web服务上何时部署到生产中。我有这个问题 WebSocket连接到“ws://www.mydomain.com/cable”失败:帧头无效 我的nginx配置文件 upstream my_app { server unix:///var/run/puma/my_app.sock; } server { listen 80; server_name www.mydomain.com;

我有一个actioncable应用程序,在开发时可以正常工作,但在Amazon Web服务上何时部署到生产中。我有这个问题

WebSocket连接到“ws://www.mydomain.com/cable”失败:帧头无效

我的nginx配置文件

upstream my_app {
    server unix:///var/run/puma/my_app.sock;
  }
  server {
   listen 80;
   server_name www.mydomain.com;

   access_log /var/log/nginx/access.log;
   error_log /var/log/nginx/error.log;
   root /var/app/current/public;

   location / {
    try_files $uri @ruby;
   }

   location @ruby {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://my_app;
   }

   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-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
   }
  }
有线电视

开发:
适配器:redis
测试:
适配器:redis
制作:
适配器:redis
url:

环境/生产.eb

config.action_cable.url = 'ws://www.mydomain.com/cable'

如果有人能帮我,请告诉我

我不确定它是否有用,但是我的production.rb有这个
config.action\u cable.url=“wss://{ENV['RAILS\u HOST']}/cable”
我肯定你也看到了吗?谢谢,但不起作用=(@JuanCarlosGamezLozano)你能想出解决办法吗?