Add Rules documentation updates#31670
Conversation
Document undocumented behaviors and configuration guidance across Rules, ruleset engine, custom errors, and bulk redirects: 1. http.host always raw, even with Origin Rules host override 3. Custom Error Rules vs default WAF block page distinction 4. Custom error asset size limit (1.5 MB after base64 inlining) 5. Bulk Redirects execution order relative to WAF 6. X-Real-IP and other protected headers via Snippets/Workers subrequest 7. x-forwarded-for re-added by Cloudflare backend proxy after rule phases 11. Maximum 64 regular expressions per rule expression 12. Preserve query string overwrites target URL query string Resolves DEE-3644
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
Review for PR #31670SummaryThis PR adds accurate, tightly-scoped documentation updates across 6 files (+32/-5) in the Rules, ruleset engine, and fields reference areas. The changes address previously undocumented limits, execution-order edge cases, and configuration guidance sourced from an internal wiki review. Automated checksSuggested labels
Inline review comments1.
|
| File | Change |
|---|---|
src/content/fields/index.yaml |
Expands http.host description to clarify that Origin Rules overrides are invisible to other phases, Workers, and request.cf. |
src/content/docs/rules/custom-errors/index.mdx |
Clarifies that Custom Error Rules do not override the default WAF block page; adds new Size limits section documenting the ~1.5 MB asset limit. |
src/content/docs/rules/url-forwarding/bulk-redirects/index.mdx |
New section explaining that Bulk Redirects run after WAF, so firewall events are still logged even for redirected requests. |
src/content/docs/rules/transform/request-header-modification/index.mdx |
Adds workaround for setting protected headers (e.g. x-real-ip) via Snippets or Workers subrequests; corrects x-forwarded-for re-addition behavior from "cache service" to "backend proxy". |
src/content/docs/ruleset-engine/rules-language/expressions/index.mdx |
New section documenting the 64-regular-expression limit per rule expression. |
src/content/docs/rules/url-forwarding/bulk-redirects/reference/parameters.mdx |
Adds :::caution admonition that Preserve query string overwrites any query string present in the target URL. |
Verdict
Approve with minor suggestions. The content is technically accurate, follows the style guide, and all CI checks pass. The request.cf wording in index.yaml is the only item that should be tightened before merge.
- http.host: drop misleading request.cf reference (it holds metadata
like colo/country, not the host header)
- custom-errors: nest 'Size limits' as H3 under 'Custom Error Assets'
(the limit is asset-specific, not page-wide)
- custom-errors: align casing ('custom error rule' lowercase to match
the rest of the page)
Summary
Documentation updates covering undocumented behaviors, configuration guidance, and execution order details across Rules, ruleset engine, custom errors, and bulk redirects.
Source: Wiki review page
Changes (8 updates across 6 files)
http.hostalways rawsrc/content/fields/index.yamlhttp.hostseen by other rule phases, Workers, orrequest.cfrules/custom-errors/index.mdxrules/custom-errors/index.mdxrules/url-forwarding/bulk-redirects/index.mdxrules/transform/request-header-modification/index.mdxrules/transform/request-header-modification/index.mdxx-forwarded-forafter all rule phases (not the cache service)ruleset-engine/rules-language/expressions/index.mdxrules/url-forwarding/bulk-redirects/reference/parameters.mdxExcluded (per Jira)
wildcard_replaceinsideregex_replaceStats
6 files changed, +32 insertions, -5 deletions
Resolves DEE-3644