nginx + cloudlflare = socket.io 502 errors?!
-
Im running NodeBB 1.17.1 and nginx/1.19.6 on the same machine as proxy. The whole machine is behind cloudflare.
everything works beside a little problem with the socket.io
https://url.mydomain/socket.io/?EIO=4&transport=polling&t=NnHgkjh
gives very often 502 errors. Whatever i set in my nginx conf does not seem to help.
People loosing the connection for some seconds before they can continue.
is this a common problem or does it have something todo with cloudflare?
btw the page https://docs.nodebb.org/installing/os/configuring/nginx rerturn error 404 and is referenced in the documentation
-
Where is that link referenced in the docs? Correct link should be this:
-
Have you seen this FAQ topic?
[FAQ] Websockets not working due to misconfigured origins
This FAQ is applicable for the following situations: You're receiving the following error in the Javascript console: WebSocket connection to 'wss:///socket...
NodeBB Community (community.nodebb.org)
-
@pitaj yes i have read this...
i finally resolved this issue..
it was the way nodebb got started in my initd script
the PIDFile was responsible for this bug
after correcting the path from
/var/run/nodebb.pid
to
/var/www/nodebb/pidfile
it works like a charm.. strange isn't it? but i am happy to finally got this resolved
thanks
-
@joker-0 sounds like NodeBB was probably constantly being restarted by initd. That would certainly cause these issues. Glad you figured it out.