rails 5, NGINX Error during WebSocket handshake: Unexpected response code: 404 -
i try deploy simple web chat server (nginx/puma). receive error console of browser:
websocket connection 'ws://domain.com/cable' failed: error during websocket handshake: unexpected response code: 404
my config server 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"; } }
is wrong where? setup before. please me work out it
Comments
Post a Comment