This rule will apply a custom request header to the CDN requests toward your origin server. It can be used as a check for specific browsing habits or confirmation that a request was made by the CDN for troubleshooting purposes.
If you have not already, please check this guide to get started.
Creating the Rule
- Select the CDN Site you would like to create the rule for
- Navigate to the EdgeRules tab
- Select Add Custom Rule
- In the IF section, add a Matches option for the CDN URL (or any Delivery Domain)
- In the DO section, add the desired request header. The StackPath CDN will apply the header directly to any requests made by the CDN toward the origin server.
Apply this rule to any number of file types by prefixing them with a ? to indicate a wildcard location, and | to separate them. For Example, the rule /\.(?.pdf|htm?l|jpe?g|gif)$/ will apply to pdf, html, jpg, jpeg, and gif files.
Verifying the Rule
This rule does not add any publicly accessible headers or redirects and will need to be confirmed through checking the access logs on the origin server. Please consult your hosting provider for the appropriate steps to view these.
If you have any questions or would like assistance creating this rule, feel free to contact our 24/7 live support.