你好。
我阅读了一些关于 Cloudflare 和 Discourse 的指南,但并没有从中得到清晰明确的结论。有些说法称 Discourse 和 Cloudflare 无法很好地协同工作,另一些则说可以;有的提到需要在 app.yml 中进行一些调整(例如添加额外的子域名),而另一些则表示无需任何调整即可正常运行。
根据我的经验,Discourse 在不进行任何调整的情况下似乎也能正常工作(我曾担心进行这些调整,因为我不太理解其原理,也担心指南可能已过时)。
另一方面,这里的一位用户在被问及如何增强安全性时,建议我“将 Discourse 置于 Cloudflare 之后,并设置一条页面规则以‘禁用性能优化’,以免其干扰代码”。这条规则应该是什么样的?我完全不清楚。
如您所见,我在这方面需要一些帮助。
提前感谢。
Remah
(Just another happy Discourse user)
2019 年11 月 14 日 08:07
2
All posts are not created equal so have you looked at the official how-to for admins:
Fastly , CloudFlare and a few other CDNs offer a mode where they accelerate dynamic content.
In a nutshell you point your domain IP address at the CDN and the CDN will intelligently decide how to deal with the request.
Static content can be easily served from cache
Dynamic content can be routed to the site.
This provides some advantages over only shipping static assets which is covered in the CDN howto .
You can elect for “shielding ” that protects your site from traffic spikes.
Dynamic cont…
I don’t use Cloudflare but I understand that you should disable Cloudflare’s speed/performance optimizations for JavaScript, CSS and HTML. It is particularly important to disable Rocket Loader:
https://support.cloudflare.com/hc/en-us/articles/200168206-How-do-I-access-my-Cloudflare-Performance-Settings-
3 个赞
bartv
(Bart )
2019 年11 月 14 日 08:13
3
We use Cloudflare with Discourse, but there are some things to watch out for. Here’s our setup:
I’m using Cloudflare on my Discourse site and it works fine. You basically route all your traffic through Cloudflare and tell it what to process or cache and that’s it. There are a few things to keep in mind though:
Configure Cloudflare to NOT cache anything (set up exceptions using page rules, see below).
Don’t let Cloudflare touch your Javascript - specifically, turn off Rocket Loader.
I’m not sure about Brotli compression yet, I disabled it.
Set up page rules to cache the avatar and upload …
6 个赞