Setting up Discourse self-install with Cloudflare


#1

Hello - we use Discourse conversation software for our site discussions.ftw.in which is behind Cloudflare.

We are having an issue setting up Discourse properly behind Cloudflare. I’ve asked the Discourse community and they are responding that we need to set up “long polling” correctly as Cloudflare blocks long polling requests.

Is anyone familiar long polling and if Cloudflare does block long polling? And if so, is there a way to whitelist or page rule for long polling instead of setting up another server just for this outside of our environment?

Note: our main site ftw.in and discussions.ftw.in are whitelisted in Cloudflare’s firewall already.

Thanks in advance


#2

In searching for answers, one term popped up: WebSockets. Do you have this feature turned on under Cloudflare’s Network tab? It seems like it’s the type of thing that will hold a connection open.

As for the whitelisting, I think that’s only for visitor IPs and Domains.


#3

Thanks for the response. Yes, WebSockets are enabled, but as I understand, a websocket is not the same thing as long polling.


#4

The only other reference that seemed helpful was:
https://renoirboulanger.com/blog/2015/05/make-discourse-long-polling-work-behind-fastly/


#5

As a fresh user, I don’t seem to have rights to start a new topic yet – this is the closest I could find.

Paging @staff with a critical bug report. Some time during last week, about 4 days ago, the long polling has stopped working on my CloudFlare enabled Discourse instances (for example tappara.co), after being functional for years. This issue is easily reproduced by editing a post and observing the delay for the changes to appear on the edited post – they are not instant anymore, but appear only up to 30 seconds later, after the Discourse polling event.

This issue also impacts other events such as post flagging, user votes etc. More discussion at Discourse Meta.