|
| 1 | +--- |
| 2 | +title: Azure Front Door | Microsoft Docs |
| 3 | +description: This article provides an overview of Azure Front Door. Find out if it is the right choice for load-balancing user traffic for your application. |
| 4 | +services: frontdoor |
| 5 | +documentationcenter: '' |
| 6 | +author: megan-beatty |
| 7 | +editor: '' |
| 8 | +ms.service: frontdoor |
| 9 | +ms.devlang: na |
| 10 | +ms.topic: overview |
| 11 | +ms.tgt_pltfrm: na |
| 12 | +ms.workload: infrastructure-services |
| 13 | +ms.date: 4/30/2020 |
| 14 | +ms.author: mebeatty |
| 15 | +# customer intent: As an IT admin, I want to learn about Front Door and what new features are available. |
| 16 | +--- |
| 17 | + |
| 18 | +# Azure Front Door Rules Engine Match Conditions |
| 19 | + |
| 20 | +In [AFD Rules Engine](front-door-rules-engine.md) a rule consists of zero or more match conditions and an action. This article provides detailed descriptions of the match conditions you can use in AFD Rules Engine. |
| 21 | + |
| 22 | +The first part of a rule is a match condition or set of match conditions. A rule can consist of up to 10 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 all match conditions that support multiple values (noted below as "space-separated"), the "OR" operator is assumed. |
| 23 | + |
| 24 | +For example, you can use a match condition to: |
| 25 | + |
| 26 | +- Filter requests based on a specific IP address, country, or region. |
| 27 | +- Filter requests by header information. |
| 28 | +- Filter requests from mobile devices or desktop devices. |
| 29 | + |
| 30 | +The following match conditions are available to use in Azure Front Door Rules engine. |
| 31 | + |
| 32 | +## Device type |
| 33 | + |
| 34 | +Identifies requests made from a mobile device or desktop device. |
| 35 | + |
| 36 | +#### Required fields |
| 37 | + |
| 38 | +Operator | Supported values |
| 39 | +---------|---------------- |
| 40 | +Equals, Not equals | Mobile, Desktop |
| 41 | + |
| 42 | +## Post argument |
| 43 | + |
| 44 | +Identifies requests based on arguments defined for the POST request method that's used in the request. |
| 45 | + |
| 46 | +#### Required fields |
| 47 | + |
| 48 | +Argument name | Operator | Argument value | Case transform |
| 49 | +--------------|----------|----------------|--------------- |
| 50 | +String | [Standard operator list](#standard-operator-list) | String, Int | Lowercase, Uppercase, Trim, Remove Whitespace, URL Encode, URL decode |
| 51 | + |
| 52 | +## Query string |
| 53 | + |
| 54 | +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. |
| 55 | + |
| 56 | +#### Required fields |
| 57 | + |
| 58 | +Operator | Query string | Case Transform |
| 59 | +---------|--------------|--------------- |
| 60 | +[Standard operator list](#standard-operator-list) | String, Int | Lowercase, Uppercase, Trim, Remove Whitespace, URL Encode, URL decode |
| 61 | + |
| 62 | +## Remote address |
| 63 | + |
| 64 | +Identifies requests based on the requester's location or IP address. |
| 65 | + |
| 66 | +#### Required fields |
| 67 | + |
| 68 | +Operator | Supported values |
| 69 | +---------|----------------- |
| 70 | +Geo Match | Country code |
| 71 | +IP Match | IP address (space-separated) |
| 72 | +Not Geo Match | Country code |
| 73 | +Not IP Match | IP address (space-separated) |
| 74 | + |
| 75 | +#### Key information |
| 76 | + |
| 77 | +- Use CIDR notation. |
| 78 | +- To specify multiple IP addresses and IP address blocks, use a single space between the values: |
| 79 | + - **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. |
| 80 | + - **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. |
| 81 | +- The syntax for an IP address block is the base IP address followed by a forward slash and the prefix size. For example: |
| 82 | + - **IPv4 example**: *5.5.5.64/26* matches any requests that arrive from addresses 5.5.5.64 through 5.5.5.127. |
| 83 | + - **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. |
| 84 | + |
| 85 | +## Request body |
| 86 | + |
| 87 | +Identifies requests based on specific text that appears in the body of the request. |
| 88 | + |
| 89 | +#### Required fields |
| 90 | + |
| 91 | +Operator | Request body | Case transform |
| 92 | +---------|--------------|--------------- |
| 93 | +[Standard operator list](#standard-operator-list) | String, Int | Lowercase, Uppercase, Trim, Remove Whitespace, URL Encode, URL decode |
| 94 | + |
| 95 | +## Request header |
| 96 | + |
| 97 | +Identifies requests that use a specific header in the request. |
| 98 | + |
| 99 | +#### Required fields |
| 100 | + |
| 101 | +Header name | Operator | Header value | Case transform |
| 102 | +------------|----------|--------------|--------------- |
| 103 | +String | [Standard operator list](#standard-operator-list) | String, Int | Lowercase, Uppercase, Trim, Remove Whitespace, URL Encode, URL decode |
| 104 | + |
| 105 | +## Request method |
| 106 | + |
| 107 | +Identifies requests that use the specified request method. |
| 108 | + |
| 109 | +#### Required fields |
| 110 | + |
| 111 | +Operator | Supported values |
| 112 | +---------|---------------- |
| 113 | +Equals, Not equals | GET, POST, PUT, DELETE, HEAD, OPTIONS, TRACE |
| 114 | + |
| 115 | +#### Key information |
| 116 | + |
| 117 | +- Only the GET request method can generate cached content in Azure Front Door. All other request methods are proxied through the network. |
| 118 | + |
| 119 | +## Request protocol |
| 120 | + |
| 121 | +Identifies requests that use the specified protocol used. |
| 122 | + |
| 123 | +#### Required fields |
| 124 | + |
| 125 | +Operator | Supported values |
| 126 | +---------|---------------- |
| 127 | +Equals, Not equals | HTTP, HTTPS |
| 128 | + |
| 129 | +## Request URL |
| 130 | + |
| 131 | +Identifies requests that match the specified URL. |
| 132 | + |
| 133 | +#### Required fields |
| 134 | + |
| 135 | +Operator | Request URL | Case transform |
| 136 | +---------|-------------|--------------- |
| 137 | +[Standard operator list](#standard-operator-list) | String, Int | Lowercase, Uppercase, Trim, Remove Whitespace, URL Encode, URL decode |
| 138 | + |
| 139 | +#### Key information |
| 140 | + |
| 141 | +- When you use this rule condition, be sure to include protocol information. For example: *https://www.\<yourdomain\>.com*. |
| 142 | + |
| 143 | +## Request file extension |
| 144 | + |
| 145 | +Identifies requests that include the specified file extension in the file name in the requesting URL. |
| 146 | + |
| 147 | +#### Required fields |
| 148 | + |
| 149 | +Operator | Extension | Case transform |
| 150 | +---------|-----------|--------------- |
| 151 | +[Standard operator list](#standard-operator-list) | String, Int | Lowercase, Uppercase, Trim, Remove Whitespace, URL Encode, URL decode |
| 152 | + |
| 153 | +#### Key information |
| 154 | + |
| 155 | +- For extension, don't include a leading period; for example, use *html* instead of *.html*. |
| 156 | + |
| 157 | +## Request file name |
| 158 | + |
| 159 | +Identifies requests that include the specified file name in the requesting URL. |
| 160 | + |
| 161 | +#### Required fields |
| 162 | + |
| 163 | +Operator | File name | Case transform |
| 164 | +---------|-----------|--------------- |
| 165 | +[Standard operator list](#standard-operator-list) | String, Int | Lowercase, Uppercase, Trim, Remove Whitespace, URL Encode, URL decode |
| 166 | + |
| 167 | +#### Key information |
| 168 | + |
| 169 | +- To specify multiple file names, separate each file name by pressing ENTER. |
| 170 | + |
| 171 | +## Request path |
| 172 | + |
| 173 | +Identifies requests that include the specified path in the requesting URL. |
| 174 | + |
| 175 | +#### Required fields |
| 176 | + |
| 177 | +Operator | Value | Case Transform |
| 178 | +---------|-------|--------------- |
| 179 | +[Standard operator list](#standard-operator-list) | String, Int | Lowercase, Uppercase, Trim, Remove Whitespace, URL Encode, URL decode |
| 180 | + |
| 181 | +## Standard operator list |
| 182 | + |
| 183 | +For rules that accept values from the standard operator list, the following operators are valid: |
| 184 | + |
| 185 | +- Any |
| 186 | +- Equals |
| 187 | +- Contains |
| 188 | +- Begins with |
| 189 | +- Ends with |
| 190 | +- Less than |
| 191 | +- Less than or equals |
| 192 | +- Greater than |
| 193 | +- Greater than or equals |
| 194 | +- Not any |
| 195 | +- Not contains |
| 196 | +- Not begins with |
| 197 | +- Not ends with |
| 198 | +- Not less than |
| 199 | +- Not less than or equals |
| 200 | +- Not greater than |
| 201 | +- Not greater than or equals |
| 202 | + |
| 203 | +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. |
| 204 | + |
| 205 | + |
| 206 | +## Next steps |
| 207 | + |
| 208 | +- Learn how to set up your first [Rules Engine configuration](front-door-tutorial-rules-engine.md). |
| 209 | +- Learn more about [Rules Engine actions](front-door-rules-engine-actions.md) |
| 210 | +- Learn more about [Azure Front Door Rules Engine](front-door-rules-engine.md) |
0 commit comments