I'm running a bundled Meteor app with passenger in nginx integration mode and everything works except for when sockjs falls back to XHR requests.
I get this behaviour in my own apps and the leaderboards example (I haven't tested other examples).
You can test it by disabling web sockets using the DISABLE_WEBSOCKETS environmental variable.
My nginx config for the site looks like this
server
{
server_name ng;
root /var/www/mysitename/public;
charset utf-8;
passenger_enabled on;
passenger_set_cgi_param MONGO_URL mongodb://localhost:27017/mydbname;
passenger_set_cgi_param ROOT_URL http://mysitename;
passenger_set_cgi_param DISABLE_WEBSOCKETS 1;
passenger_set_cgi_param PASSENGER_STICKY_SESSION true;
}
Then when I go to the site and open the network panel in the developer console on Chrome I get the errors like these
...
POST http://mysitename/sockjs/158/ck8pi__5/xhr_send 404 (Not Found)
POST http://mysitename/sockjs/519/4hgc4rgr/xhr_send 404 (Not Found)
POST http://mysitename/sockjs/672/6gq99fp5/xhr_send 404 (Not Found)
POST http://mysitename/sockjs/682/sx0e2w_v/xhr_send 404 (Not Found)
...
Essentially it keeps on creating new connections, like it is unable to continue existing ones, this appears to only happen with XHR requests, not websockets as I guess XHR require the sticky session state.
But I have enabled sticky sessions (PASSENGER_STICKY_SESSION environmental variable) and am seeing the session cookie in the resources pane, but it still has the same 404 problem.
I'm using Phusion Passenger version 4.0.40 and Meteor 0.8.1.2 on Arch Linux 64 bit.

所有评论(0)