小编Jim*_*one的帖子

RoR 5.0.0 ActionCable wss WebSocket握手:意外的响应代码:301

您好我正在尝试使用ror 5.0.0 beta(使用puma)进行简单聊天,在生产模式下工作(在localhost中没有问题).

这是我的Nginx配置:

upstream websocket {
    server 127.0.0.1:28080;
}


server {

    listen 443;
    server_name mydomain;
    ssl_certificate ***/server.crt;
    ssl_certificate_key ***/server.key;
    ssl on;
    ssl_session_cache builtin:1000 shared:SSL:10m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers 
HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_prefer_server_ciphers on;
    access_log /var/log/nginx/jenkins.access.log;

    location / {
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_pass http://localhost:3000;
      proxy_read_timeout 90;

      proxy_redirect http://localhost:3000 https://mydomain;


    location /cable/{
        proxy_pass         http://websocket/;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection "upgrade";
        proxy_set_header   Host $http_host;
        break;
    }

   }
Run Code Online (Sandbox Code Playgroud)

这是config/redis/cable.yml

production:url:redis:// …

wss nginx puma ruby-on-rails-5 actioncable

8
推荐指数
1
解决办法
4693
查看次数

放大:无法获取配置文件:缺少配置文件配置:未定义

我的amplify cli遇到一些问题:我不知道它是否与最近的 cli 更新有关......

amplify init
? Do you want to use an existing environment? Yes
? Choose the environment you would like to use: staging
Using default provider  awscloudformation
? Select the authentication method you want to use: AWS profile
Failed to get profile: Profile configuration is missing for: undefined
Run Code Online (Sandbox Code Playgroud)
amplify configure
Specify the AWS Region xxx
Specify the username of the new IAM user: xxx
Complete the user creation using the AWS console

Enter the access key …
Run Code Online (Sandbox Code Playgroud)

amazon-iam aws-amplify aws-amplify-cli

6
推荐指数
1
解决办法
5687
查看次数