Origin rule #1
Parameter | Value |
---|---|
Set Host header | example.com |
Set destination port | 8081 |
Below you will find answers to the most commonly asked questions regarding Origin Rules.
In this situation the origin rule parameters will override the page rule parameters.
Consider the following example scenarios:
Host
header defined by the page rule and the origin hostname defined by the origin rule.Host
header defined by the origin rule.Yes. Refer to the Page Rules migration guide for any updates on the migration process.
If two or more origin rules match a request, the configuration of those rules is merged. While merging two configurations, the settings of later rules will override the settings defined in previous rules, updating or adding configuration properties. The final configuration applied by Cloudflare will be this merged version.
For example, if you configure the following two origin rules and both rules match, Cloudflare will use the destination port set by the first rule, and the DNS hostname override and Host
header value set by the second rule.
Origin rule #1
Parameter | Value |
---|---|
Set Host header | example.com |
Set destination port | 8081 |
Origin rule #2
Parameter | Value |
---|---|
Set Host header | example.net |
Set DNS hostname | example.net |
JSON example for API users
When using the API, you configure origin rule parameters in an action_parameters
object.
The merged configuration to apply would be the following:
Parameter | Value |
---|---|
Set Host header | example.net |
Set destination port | 8081 |
Set DNS hostname | example.net |
If you also configured a destination port in rule #2, that value would override the 8081
destination port defined in rule #1.