Overview
You can use this document to apply a custom request header to the CDN requests for your origin server.
This rule can be used to check for specific browsing habits or confirmation that a request was made by the CDN for troubleshooting purposes.
Step 1: Create a rule
- In the StackPath Control Portal, in the left-side navigation, click Sites.
- Locate and select the desired site.
- In the left-side navigation, click Edge Rules.
- Click Edge Rules.
- Scroll down to Delivery Rules, and then click Add Delivery Rule.
- In Rule Name, enter a descriptive name for the rule.
- Create and save the following EdgeRule:
If URL Matches *://Edge.Address/*
- Enter your own edge address or desired delivery domain.
Then Add Header To Origin
- Select the desired request header.
Header
- Enter the name of the header.
CDN
- Enter a value.
Note:
To apply this rule to different file types, prefix the rule with a question mark ( ? ) to indicate a wildcard location, and use a vertical bar ( | ) to separate each file type.
For example, the following rule applies to PDF, HTML, JPG, JPEG, and GIT files:/\.(?.pdf|htm?l|jpe?g|gif)$/
Step 2: Verify the rule
This rule does not add any publicly accessible headers or redirects. As a result, to verify the rule, you will need to check the access logs on the origin server.
Please consult your hosting provider to learn how to view the access logs.