问题原文
原帖链接 · Caymen · CC BY-SA 4.0
I have a Cloudflare website and it is hosted on Cloudflare Pages, but I want to add HTTP headers to this website. There are a lot of DNS and HTTP related settings in Cloudflare. I am undecided which one to do.
My question is How can I add http headers in Cloudflare?
已采纳解答
原帖链接 · ardacarofficial · CC BY-SA 4.0
Follow the steps below to add HTTP headers in Cloudflare:
- Select your website.
Click Rulesfrom the left side menu.Click Transform Rulesin the menu that opens underRules.- There are 4 different options in
Transform Rules, but not in the menu, but in the page section, selectModify Response Headerfrom this page section. - Press the
Create Rulebutton. - In the first
Rule Namesection, type any name you want, just any importance to personalise it. When incoming requests match...question, if you are going to add HTTP header to the whole site, clickAll Incoming Requestsoption, if you are going to select a specific page, select the 2nd option there and apply the filtering.- Press the
Set New Headerbutton to add the HTTP header under the Then section. - In the Set Static section, select the
Staticsection and type the HTTP header you want to enter in the 2 boxes that appear. - Press
Saveand the HTTP header is now added.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
