我尝试部署一个简单的networking聊天服务器(Nginx /美洲狮)。 但是我收到浏览器的错误控制台:
WebSocket connection to 'ws://domain.com/cable' failed: Error during WebSocket handshake: Unexpected response code: 404
我的configuration服务器domain.conf:
upstream backend { server unix:///var/run/backend.sock; } server { listen 80 ; server_name domain.com; root /home/rails/backend/public; access_log /home/rails/backend/log/nginx.access.log; error_log /home/rails/backend/log/nginx.error.log info; try_files $uri/index.html $uri @backend; location @backend { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://backend; } location ^~ /assets/ { gzip_static on; expires max; add_header Cache-Control public; } location /cable { proxy_pass http://gifty; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }
有些地方有错吗? AnyOne安装之前。 请帮我解决它