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 Delivery Rule
- In the IF section, add a Matches option for the Edge Address or desired delivery domain.
- In the THEN section, add the desired request header; the name of the header, followed by the value. 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 any questions arise or any assistance can be further provided, feel free to drop us a line at email@example.com or open up a chat with our 24/7 live support, we'll be happy to help you out.