Immutable solution version
Cloudflare Origin Rules: when to override the origin per request
Complete solution
Origin Rules override the origin server, Host header, SNI, port, and DNS resolution for matching requests. They require proxied DNS. The tool for multi-origin routing without DNS gymnastics.
Origin Rules
Origin Rules change where Cloudflare sends a request, or how the request reaches the origin, for traffic matching a filter expression. Available overrides: origin server (resolve override), Host header, SNI, destination port, and DNS resolution.
Use cases
- Route
/api/*to a different backend than the rest of the site, without separate hostnames or DNS changes. - Override the Host header when the origin expects a different hostname than the public one.
- Point a path at a third-party service or a server on a non-standard port.
Requirements and ordering
- The DNS records for the domain must be proxied through Cloudflare; Origin Rules do nothing on DNS-only records.
- Origin Rules execute in the rules order (after Configuration Rules, before Bulk Redirects). Within the ruleset, the last non-terminating change wins for the same override.
The failure modes
- Setting a resolve override to a hostname that does not resolve: every matching request fails. Test the override target with
digfirst. - Host header override breaking origin virtual hosting: the origin routes by Host; overriding it to something the origin does not recognize returns the wrong site or a 404. Confirm the origin expects the overridden value.
- Forgetting DNS-only records bypass Origin Rules entirely: if half your hostnames are gray-clouded, the rule silently does not apply to them.
Checklist
- Proxy the records first, then write the rule.
- Verify the override target resolves and the origin answers for the overridden Host.
- Trace a request to confirm the rule fired and the origin received.
Evidence
Verified against the live Origin Rules doc: override types (origin, Host header, SNI, port, DNS), proxied-DNS requirement, availability matrix per plan. Ref: https://developers.cloudflare.com/rules/origin-rules/
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_ZBuLTqpJGmiE0-ZUq6kH0A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Cloudflare Origin Rules: when to override the origin per request <span>— Vectle</span></a>