Websocket-rails doesn't work on production evironment with Nginx and Unicorn

落花浮王杯 提交于 2019-12-05 08:06:23

Your nginx config is matching requests below /websocket/ with the trailing /. That is the directory component of /websocket/blah.

If you look in your nginx access log file you'll find your requests to /websocket are being 301 redirected to /websocket/.

Remove the trailing /

location /websocket {
   proxy_pass http://localhost:3001/websocket;
   proxy_http_version 1.1;
   proxy_set_header Upgrade $http_upgrade;
   proxy_set_header Connection "upgrade";
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!