Match conditions in the Standard rules engine for Azure Content Delivery Network
Important
Azure CDN Standard from Microsoft (classic) will be retired on September 30, 2027. To avoid any service disruption, it's important that you migrate your Azure CDN Standard from Microsoft (classic) profiles to Azure Front Door Standard or Premium tier by September 30, 2027. For more information, see Azure CDN Standard from Microsoft (classic) retirement.
Azure CDN from Edgio was retired on January 15, 2025. For more information, see Azure CDN from Edgio retirement FAQ.
In the Standard rules engine for Azure Content Delivery Network, a rule consists of one or more match conditions and an action. This article provides detailed descriptions of the match conditions you can use in the Standard rules engine for Azure Content Delivery Network.
The first part of a rule is a match condition or set of match conditions. In the Standard rules engine for Azure Content Delivery Network, each rule can have up to four match conditions. A match condition identifies specific types of requests for which defined actions are performed. If you use multiple match conditions, the match conditions are grouped together by using AND logic.
For example, you can use a match condition to:
- Filter requests based on a specific IP address or country/region.
- Filter requests by header information.
- Filter requests from mobile devices or desktop devices.
The following match conditions are available to use in the Standard rules engine for Azure Content Delivery Network.
Identifies requests made from a mobile device or desktop device.
Operator | Supported values |
---|---|
Equals, Not equals | Mobile, Desktop |
Identifies requests based on the HTTP version of the request.
Operator | Supported values |
---|---|
Equals, Not equals | 2.0, 1.1, 1.0, 0.9, All |
Identifies requests based on cookie information in the incoming request.
Cookie name | Operator | Cookie value | Case transform |
---|---|---|---|
String | Standard operator list | String, Int | No transform, to uppercase, to lowercase |
- You can't use wildcard values (including asterisks (*)) when you specify a cookie name; you must use an exact cookie name.
- You can specify only a single cookie name per instance of this match condition.
- Cookie name comparisons are case-insensitive.
- To specify multiple cookie values, use a single space between each cookie value.
- Cookie values can take advantage of wildcard values.
- If a wildcard value hasn't been specified, only an exact match satisfies this match condition. For example, "Value" matches "Value" but not "Value1".
Identifies requests based on arguments defined for the POST request method that's used in the request.
Argument name | Operator | Argument value | Case transform |
---|---|---|---|
String | Standard operator list | String, Int | No transform, to uppercase, to lowercase |
Identifies requests that contain a specific query string parameter. This parameter is set to a value that matches a specific pattern. Query string parameters (for example, parameter=value) in the request URL determine whether this condition is met. This match condition identifies a query string parameter by its name and accepts one or more values for the parameter value.
Operator | Query string | Case Transform |
---|---|---|
Standard operator list | String, Int | No transform, to uppercase, to lowercase |
Identifies requests based on the requester's location or IP address.
Operator | Supported values |
---|---|
Any | N/A |
Geo Match | Country code |
IP Match | IP address (space-separated) |
Not Any | N/A |
Not Geo Match | Country code |
Not IP Match | IP address (space-separated) |
- Use classless inter-domain routing (CIDR) notation.
- To specify multiple IP addresses and IP address blocks, use a single space between the values:
- IPv4 example: 1.2.3.4 10.20.30.40 matches any requests that arrive from either address 1.2.3.4 or 10.20.30.40.
- IPv6 example: 1:2:3:4:5:6:7:8 10:20:30:40:50:60:70:80 matches any requests that arrive from either address 1:2:3:4:5:6:7:8 or 10:20:30:40:50:60:70:80.
- The syntax for an IP address block is the base IP address followed by a forward slash and the prefix size. For example:
- IPv4 example: 5.5.5.64/26 matches any requests that arrive from addresses 5.5.5.64 through 5.5.5.127.
- IPv6 example: 1:2:3:/48 matches any requests that arrive from addresses 1:2:3:0:0:0:0:0 through 1:2:3:ffff:ffff:ffff:ffff:ffff.
- Remote Address represents the original client IP that is either from the network connection or typically the X-Forwarded-For request header if the user is behind a proxy.
Identifies requests based on specific text that appears in the body of the request.
Operator | Request body | Case transform |
---|---|---|
Standard operator list | String, Int | No transform, to uppercase, to lowercase |
Identifies requests that use a specific header in the request.
Header name | Operator | Header value | Case transform |
---|---|---|---|
String | Standard operator list | String, Int | No transform, to uppercase, to lowercase |
Identifies requests that use the specified request method.
Operator | Supported values |
---|---|
Equals, Not equals | GET, POST, PUT, DELETE, HEAD, OPTIONS, TRACE |
- Only the GET request method can generate cached content in Azure Content Delivery Network. All other request methods are proxied through the network.
Identifies requests that use the specified protocol used.
Operator | Supported values |
---|---|
Equals, Not equals | HTTP, HTTPS |
Identifies requests that match the specified URL.
Operator | Request URL | Case transform |
---|---|---|
Standard operator list | String, Int | No transform, to uppercase, to lowercase |
- When you use this rule condition, be sure to include protocol information. For example: https://www.<yourdomain>.com.
Identifies requests that include the specified file extension in the file name in the requesting URL.
Operator | Extension | Case transform |
---|---|---|
Standard operator list | String, Int | No transform, to uppercase, to lowercase |
- For extension, don't include a leading period; for example, use html instead of .html.
Identifies requests that include the specified file name in the requesting URL.
Operator | File name | Case transform |
---|---|---|
Standard operator list | String, Int | No transform, to uppercase, to lowercase |
- To specify multiple file names, separate each file name with a single space.
Identifies requests that include the specified path in the requesting URL.
Operator | Value | Case Transform |
---|---|---|
Standard operator list | String, Int | No transform, to uppercase, to lowercase |
- A file name value can take advantage of wildcard values. For example, each file name pattern can consist of one or more asterisks (*), where each asterisk matches a sequence of one or more characters.
For rules that accept values from the standard operator list, the following operators are valid:
- Any
- Equals
- Contains
- Begins with
- Ends with
- Less than
- Less than or equals
- Greater than
- Greater than or equals
- Not any
- Not contains
- Not begins with
- Not ends with
- Not less than
- Not less than or equals
- Not greater than
- Not greater than or equals
For numeric operators like Less than and Greater than or equals, the comparison used is based on length. In this case, the value in the match condition should be an integer that's equal to the length you want to compare.