大网数据广告活动
网站运营与故障问答

How can I add HTTP headers in Cloudflare?

· 52CE 我爱测

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 …

问题原文

原帖链接 · 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:

  1. Select your website.
  2. Click Rules from the left side menu.
  3. Click Transform Rules in the menu that opens under Rules.
  4. There are 4 different options in Transform Rules, but not in the menu, but in the page section, select Modify Response Header from this page section.
  5. Press the Create Rule button.
  6. In the first Rule Name section, type any name you want, just any importance to personalise it.
  7. When incoming requests match... question, if you are going to add HTTP header to the whole site, click All Incoming Requests option, if you are going to select a specific page, select the 2nd option there and apply the filtering.
  8. Press the Set New Header button to add the HTTP header under the Then section.
  9. In the Set Static section, select the Static section and type the HTTP header you want to enter in the 2 boxes that appear.
  10. Press Save and the HTTP header is now added.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2023-10-13)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。