|
| 1 | +--- |
| 2 | +title: Azure CDN from Microsoft Standard Rules Engine match conditions | Microsoft Docs |
| 3 | +description: Reference documentation for Azure Content Delivery Network from Microsoft Standard Rules Engine match conditions. |
| 4 | +services: cdn |
| 5 | +author: mdgattuso |
| 6 | + |
| 7 | +ms.service: azure-cdn |
| 8 | +ms.topic: article |
| 9 | +ms.date: 11/01/2019 |
| 10 | +ms.author: magattus |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +# Azure CDN from Microsoft Standard Rules Engine match conditions |
| 15 | + |
| 16 | +This article lists detailed descriptions of the available match conditions for the Azure Content Delivery Network (CDN) from Microsoft [Standard Rules Engine](cdn-standard-rules-engine.md). |
| 17 | + |
| 18 | +The first part of a rule is a set of match conditions. Each rule may have up to 4 match conditions. A match condition identifies specific types of requests for which the actions definied in the rule will be performed. If you use multiple match conditions, they will be grouped together using AND logic. |
| 19 | + |
| 20 | +For example, you can use a match condition to: |
| 21 | + |
| 22 | +- Filter requests generated from a particular IP address or country/region. |
| 23 | +- Filter requests by header information. |
| 24 | +- Filter requests from Mobile or Desktop devices. |
| 25 | + |
| 26 | +## Match Conditions |
| 27 | + |
| 28 | +### Device type |
| 29 | + |
| 30 | +The Device type match condition identifies requests made from a mobile or desktop device based on its properties. |
| 31 | + |
| 32 | +**Required fields** |
| 33 | +Operator | Supported Value |
| 34 | +---------|---------------- |
| 35 | +Equals, Not equals | Mobile, Desktop |
| 36 | + |
| 37 | + |
| 38 | +### HTTP Version |
| 39 | + |
| 40 | +The HTTP Version match condition identifies requests based on the HTTP version the request arrives with. |
| 41 | + |
| 42 | +**Required fields** |
| 43 | +Operator | Supported Value |
| 44 | +---------|---------------- |
| 45 | +Equals, Not equals | 2.0, 1.1, 1.0, 0.9, All |
| 46 | + |
| 47 | + |
| 48 | +### Request cookies |
| 49 | + |
| 50 | +The Request cookies match condition identifies requests based on cookie information in the incoming request. |
| 51 | + |
| 52 | +**Required fields** |
| 53 | +Cookie Name | Operator | Cookie Value | Case Transform |
| 54 | +------------|----------|--------------|--------------- |
| 55 | +String | [Standard operator list](###standard-operator-list) | String, Int | No transform, to uppercase, to lowercase |
| 56 | + |
| 57 | +Key information |
| 58 | +- Wildcard values, including asterisks (*), are not supported when specifying a cookie name, only exact cookie name matches are eligible for comparison. |
| 59 | +- Only a single cookie name can be specified per instance of this match condition. |
| 60 | +- Cookie name comparisions are case-insensitive. |
| 61 | +- Specifiy multiple cookie values by delimiting each one with a single space. |
| 62 | +- Cookie values can take advantage of wildcard values. |
| 63 | +- If a wildcard value has not been specified, only an exact match will satisfy this match condition. For example, specifying "Value" will match "Value", but not "Value1". |
| 64 | + |
| 65 | +### Post Argument |
| 66 | + |
| 67 | +**Required fields** |
| 68 | +Argument Name | Operator | Argument Value | Case Transform |
| 69 | +--------------|----------|----------------|--------------- |
| 70 | +String | [Standard operator list](###standard-operator-list) | String, Int | No transform, to uppercase, to lowercase |
| 71 | + |
| 72 | +### Query String |
| 73 | + |
| 74 | +The Query String match conditions identifies requests containing a specified query string parameter. This parameter is set to a value that matches a specified 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. |
| 75 | + |
| 76 | +**Required fields** |
| 77 | +Operator | Query String | Case Transform |
| 78 | +---------|--------------|--------------- |
| 79 | +[Standard operator list](###standard-operator-list) | String, Int | No transform, to uppercase, to lowercase |
| 80 | + |
| 81 | +### Remote Address |
| 82 | + |
| 83 | +The Remote address match condition identify requests based on the requester's location or IP address. |
| 84 | + |
| 85 | +**Required fields** |
| 86 | +Operator | Supported Values |
| 87 | +---------|----------------- |
| 88 | +Any | N/A |
| 89 | +Geo Match | Country codes |
| 90 | +IP Match | IP addresses (space seperated) |
| 91 | +Not Any | N/A |
| 92 | +Not Geo Match | Country codes |
| 93 | +Not IP Match | IP addresses (space seperated) |
| 94 | + |
| 95 | +Key information: |
| 96 | + |
| 97 | +- Use CIDR notation. |
| 98 | +- Specify multiple IP addresses and/or IP address blocks by delimiting each one with a single space. For example: |
| 99 | + - **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. |
| 100 | + - **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. |
| 101 | +- The syntax for an IP address block is the base IP address followed by a forward slash and the prefix size. For example: |
| 102 | + - **IPv4 example**: 5.5.5.64/26 matches any requests that arrive from addresses 5.5.5.64 through 5.5.5.127. |
| 103 | + - **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. |
| 104 | + |
| 105 | +### Request Body |
| 106 | + |
| 107 | +**Required fields** |
| 108 | +Operator | Request Body | Case Transform |
| 109 | +---------|--------------|--------------- |
| 110 | +[Standard operator list](###standard-operator-list) | String, Int | No transform, to uppercase, to lowercase |
| 111 | + |
| 112 | +### Request Header |
| 113 | + |
| 114 | +**Required fields** |
| 115 | +Header Name | Operator | Header Value | Case Transform |
| 116 | +------------|----------|--------------|--------------- |
| 117 | +String | [Standard operator list](###standard-operator-list) | String, Int | No transform, to uppercase, to lowercase |
| 118 | + |
| 119 | +### Request Method |
| 120 | + |
| 121 | +**Required fields** |
| 122 | +Operator | Supported Value |
| 123 | +---------|---------------- |
| 124 | +Equals, Not equals | GET, POST, PUT, DELETE, HEAD, OPTIONS, TRACE |
| 125 | + |
| 126 | +Key information: |
| 127 | + |
| 128 | +- Only the GET request method can generate cached content on the CDN. All other request methods are proxied through the network. |
| 129 | + |
| 130 | +### Request Protocol |
| 131 | + |
| 132 | +**Required fields** |
| 133 | +Operator | Supported Value |
| 134 | +---------|---------------- |
| 135 | +Equals, Not equals | HTTP, HTTPS |
| 136 | + |
| 137 | +### Request URL |
| 138 | + |
| 139 | +**Required fields** |
| 140 | +Operator | Request URL | Case Transform |
| 141 | +---------|-------------|--------------- |
| 142 | +[Standard operator list](###standard-operator-list) | String, Int | No transform, to uppercase, to lowercase |
| 143 | + |
| 144 | +Key information: |
| 145 | + |
| 146 | +- When entering Request URL, ensure you include protocol information. For example "https://www.[yourdomain].com" |
| 147 | + |
| 148 | +### URL File Extension |
| 149 | + |
| 150 | +**Required fields** |
| 151 | +Operator | Extension | Case Transform |
| 152 | +---------|-----------|--------------- |
| 153 | +[Standard operator list](###standard-operator-list) | String, Int | No transform, to uppercase, to lowercase |
| 154 | + |
| 155 | +Key information: |
| 156 | + |
| 157 | +- For extension, do not include a leading period; for example, use html instead of .html. |
| 158 | + |
| 159 | +### URL File Name |
| 160 | + |
| 161 | +**Required fields** |
| 162 | +Operator | File name | Case Transform |
| 163 | +---------|-----------|--------------- |
| 164 | +[Standard operator list](###standard-operator-list) | String, Int | No transform, to uppercase, to lowercase |
| 165 | + |
| 166 | +Key information: |
| 167 | + |
| 168 | +- To specify multiple file names, separate each file name with a single space. |
| 169 | + |
| 170 | +### URL Path |
| 171 | + |
| 172 | +**Required fields** |
| 173 | +Operator | Value | Case Transform |
| 174 | +---------|-------|--------------- |
| 175 | +[Standard operator list](###standard-operator-list) | String, Int | No transform, to uppercase, to lowercase |
| 176 | + |
| 177 | +Key information: |
| 178 | + |
| 179 | +- 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. |
| 180 | + |
| 181 | +## Reference for rules engine match conditions |
| 182 | + |
| 183 | +### Standard Operator List |
| 184 | + |
| 185 | +For rules that contain the standard operator list, the following operators are valid: |
| 186 | + |
| 187 | +- Any |
| 188 | +- Equals |
| 189 | +- Contains |
| 190 | +- Begins with |
| 191 | +- Ends with |
| 192 | +- Less than |
| 193 | +- Less than or equals |
| 194 | +- Greater than |
| 195 | +- Greater than or equals |
| 196 | +- Not any |
| 197 | +- Not contains |
| 198 | +- Not begins with |
| 199 | +- Not ends with |
| 200 | +- Not less than |
| 201 | +- Not less than or equals |
| 202 | +- Not greater than |
| 203 | +- Not greater than or equals |
| 204 | + |
| 205 | +For numeric operators, like "Less than" or "Greater than or equals", the comparison used will based on length. In this case, the value in the match condition should be an Integer, equal to the length you would like to compare. |
| 206 | + |
| 207 | +--- |
| 208 | + |
| 209 | +[Back to top](#match-conditions) |
| 210 | + |
| 211 | +</br> |
| 212 | + |
| 213 | +## Next steps |
| 214 | + |
| 215 | +- [Azure Content Delivery Network overview](cdn-overview.md) |
| 216 | +- [Rules engine reference](cdn-standard-rules-engine-reference.md) |
| 217 | +- [Rules engine actions](cdn-standard-rules-engine-actions.md) |
| 218 | +- [Enforce HTTPS using the Standard Rules Engine](cdn-standard-rules-engine.md) |
0 commit comments