Error during WebSocket handshake, I use nginx
-
Works fine
-
Strange, i responded to the "try to reply" message but its gone now. Nevermind!
-
The normal way to configure nginx is to create an nginx config file in
/path/to/nginx/sites-available/
. You can copy one of the templates from docs.nodebb.org.You then need to create a symlink from the file (I'll call it
forum.example.com
) insites-available
tosites-enabled
ln -s /path/to/nginx/sites-available/forum.example.com /path/to/nginx/sites-enabled/forum.example.com
You don't seem to be using our nginx templates at all. Any reason why?
-
@pitaj My nginx directory only has these sub dirs:
client_body_temp conf fastcgi_temp html logs proxy_temp sbin scgi_temp uwsgi_temp
And even I do what you said, nginx still not working. I seems that my nginx can only set config by conf/nginx.conf file. sites-available/ and sites-enabled/ seems useless to me.
-
After a hard time debugging, I found out that it's not because of nginx setting. It is because I set a "cookieDomain" config. After I remove this one, it works properly. I modify source code and fix this problem. Maybe it's not a good solution, but it works for me.
-
file: src/socket.io/index, line:45
// other code // added code, force to resign variable domain = parsedUrl.hostname; // comment these codes // if (!domain) { // domain = parsedUrl.hostname; // cookies don't provide isolation by port: http://stackoverflow.com/a/16328399/122353 // } // other code