MaxCDN EdgeRules can perform functions on different parts of an HTTP request. We refer to this as Features. This article will, at a high level explain what each feature does when set as a directive for a given URI.
The EdgeRules feature is available only on Enterprise plans.
EdgeRule Features Explained
Features are the rules (directives) that you wish to apply once a URI match occurs. You may apply up to six features to a single rule. The table below lists the features currently supported.
Feature | Description | Value |
---|---|---|
STATUS CODE | The HTTP response code to send back. See Nginx return for full details. | A numeric HTTP response status code. View all possible status codes. Example: 404
|
SET VARIABLE | Define an arbitrary variable for future use. Should be used in conjunction with conditionals. See Nginx set for full details. | Dollar sign, then key, then space, and finally value. Example: $foo bar . Note that if variable contains spaces you need to encapsulate it with double quotes. Example:SET VARIABLE $var "public, max-age=123456789" ADD HEADER Cache-Control $var
|
REWRITE RULE | Modify the URI in accordance with a regular expression and a replacement string. See Nginx rewrite for full details. | String. Example: rewrite ^ http://foo.com/bar.html? permanent;
|
TTL OVERRIDE | The amount of time in seconds to cache content. See Nginx proxy cache valid for full details. | Integer. Example: 3600
|
MODIFY REQUEST HEADER | Change a request header. See Nginx modify request header for full details. | String. Example: User-Agent some-faked-agent
|
MODIFY HEADER | Change a response header. See Nginx modify response header for full details. | String. Example: Server foo-bar
|
ADD HEADER | Add a response header. See Nginx add response header for full details. | String. Example: Foo bar
|
HIDE HEADER | Hide a response header. Note, this simply strips the header from the response, it does not prevent processing of the header, unlike ignore header. | String. Example: Foo
|
NO CACHE | Prevent the CDN from serving the content, will always be a cache miss, and serve from the origin. | A boolean value of either 0 or 1 . |
DENY | Deny access to the provided location. You may use a CIDR address. The order of allow and deny directives are significant. See Nginx deny for full details. |
String. Example: 50.126.30.0/25
|
ALLOW | Allow access to the provided location. You may use a CIDR address. The order of allow and deny directives are significant. See Nginx allow for full details. |
String. Example: 50.126.30.0/25
|
IGNORE HEADER | Ignore a response header. Note, this strips the response header before processing, unlike hide header, which simply just hides the header after processing. | String. Example: Foo
|
PROXY PASS | This is NginX directive which defines back end server to be used as origin server in process of caching files. PROXY PASS can be used to define URL of back end server by reaching it via FQDN (Fully Qualified Domain Name) or by IP address where additional directive should be used to complete the request properly. Additional directive in question is MODIFY REQUEST HEADER in order to pass along appropriate "Host" header. |
String. Example(s):http://origin.com$request_uri OR http://123.123.123.123$request_uri MODIFY REQUEST HEADER Host $http_host
|
We hope this article was helpful and as always, If you have any questions or concerns about any of the topics mentioned in this article, please feel free to reach out to support - we are available 24/7 by chat or email!