NodeBB Behind CloudFlare
-
With the latest updates, does anyone know if you can use CloudFlare's CDN in front of NodeBB? I know that we used to not be able to do this, but a lot of things have been fixed in that realm since I last checked on it. Hoping that this is working now, would be awesome.
-
@scottalanmiller Cloudflare will only support Websockets on it's top tier. So, if you pay for that. Yes.
-
@a_5mith said:
@scottalanmiller Cloudflare will only support Websockets on it's top tier. So, if you pay for that. Yes.
Only $60K a year. What a deal.
-
Thanks for the response. I was the one that had @scottalanmiller ask the question.
I guess places that use websockets will have to wait for the Let's Encrypt system to get going for encryption.
-
@julian said:
You can use "Incapsula", though that might be a for-pay service as well
You can use NodeBB behind CF, but it has to be "grey clouds", not orange... which I suppose really defeats the purpose of using CF altogether...
Yes, we've always used it behind the grey clouds but yeah, defeats the purpose other than having a good DNS interface.
-
@scottalanmiller said:
other than having a good DNS interface.
Hey, that's a pretty good reason to use CF to begin with! Their DNS interface is the best I've come across
-
Yes, we always use them for that no matter what. And it keeps all of our DNS in a single place.
-
Alternatively, you could edit config.json to have websockets on a subdomain and leave CF disabled there but enable it on your main domain. That was you'd have most of the benefits of CF, except that your IP is now exposed.
You'd have to make sure Express' cookie is set correctly though, so it's sent to both the normal and the websockets subdomain. This was the root cause of my issues with this setup, plus the fact that for some reason CORS headers weren't always set correctly by socket.io.
-
@shady2k said:
@Xiph, I can't make it work with subdomain. Websocket's querys gets error with Invalid uid = 0. Could you describe your config?
Supposing your site is
example.com
and the subdomain you used for websocket iswebsockets.example.com
:
Go into the admin control panel on your NodeBB site, then go to Settings > Advanced and ensure that underneath the "Set domain for session cookie" you've written.example.com
(note the first dot). Click "Save Changes", clear your cookies and log in again. That's what solved it for me. -
that sounds like a good solution but how should i configure nginx for websockets.example.com