こんにちは。
Cloudflare と Discourse に関するいくつかのガイドを読んだのですが、明確な答えが見つかりませんでした。Discourse と Cloudflare は相性が悪いという意見もあれば、問題ないという意見もあります。app.yml の設定(追加のサブドメインなど)を調整する必要があるという人もいれば、そのままでも問題なく動作するという人もいます。
私の経験では、Discourse は調整なしでも問題なく動作しています(設定方法があまり理解できておらず、ガイドが古くなっているかもしれないと恐れていたため、調整は避けていました)。
一方で、ここではセキュリティを強化する方法について質問した際、あるユーザーが「Discourse を Cloudflare の後ろに配置し、ページルールで『パフォーマンスを無効化』して、コードを壊されないようにする」と勧めてくれました。そのルールはどのように設定すればよいのでしょうか?全くわかりません。
ご覧の通り、この件についてお手伝いが必要です。
よろしくお願いいたします。
Remah
(Just another happy Discourse user)
2019 年 11 月 14 日午前 8: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 日午前 8: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