DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

WebSocket Error 400 in Meteor App


I deploy a Meteor app, and proxy it with nginx. When connect to the app server, there's a websocket error:

WebSocket connection to 'ws://prod-app-192-168-100-21.newfairs-inc.com/sockjs/311/ud_4e5xf/websocket' failed: Error during WebSocket handshake: Unexpected response code: 400

Solution:

cat /etc/nginx/sites-enabled/newfairs
server {
  server_name prod-app-192-168-100-21.newfairs-inc.com;
  location / {
    proxy_pass http://localhost:3000/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
  }
}

Ref:

Meteor WebSocket handshake error 400 with nginx

WebSocket proxying

http://stackoverflow.com/questions/30171179/meteor-websocket-connection-to-ws-websocket-failed-error-during-websock



Published

Dec 25, 2015

Last Updated

Dec 25, 2015

Category

Tech

Tags

  • meteor 47
  • nginx 2
  • websocket 1

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor