已经通过 Capistrano 部署了我的 Rails 5.2 应用程序,并且在使用 ActionCable 时遇到了问题。我正在使用 Nginx、Puma 和 Lets Encrypt。
我尝试了多种配置组合,但每次都收到相同的错误。我不知道如何调试这个问题,建议以及重新安排我的 ngnx.conf 的任何提示都会受到赞赏。
已将真实网站更改为 website.com
配置文件
upstream puma {
server unix:///home/deploy/apps/website/shared/tmp/sockets/website-puma.sock;
}
server {
server_name website.com www.website.com;
root /home/deploy/apps/website/current/public;
index index.html;
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
}
try_files $uri/index.html $uri @puma;
location @puma {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://puma;
}
location /cable {
proxy_pass http://puma;
proxy_http_version 1.1;
proxy_set_header Upgrade websocket;
proxy_set_header Connection Upgrade;
proxy_set_header X-Real-IP …Run Code Online (Sandbox Code Playgroud)