You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A *route* in Azure Front Door defines how traffic gets handled when the incoming request arrives at the Azure Front Door edge. Through the route settings, an association is defined between a domain and an origin group. By using advance features such as *Pattern to Match* and *Rule sets*, you can have granular control over traffic to your backend resources.
18
+
A *route* in Azure Front Door defines how traffic is handled when an incoming request arrives at the Azure Front Door edge. The route settings establish an association between a domain and an origin group. By using advanced features such as *Pattern to Match* and *Rule sets*, you can have granular control over traffic to your backend resources.
19
19
20
20
> [!NOTE]
21
21
> When you use the [Front Door rule sets](front-door-rules-engine.md), you can configure a rule to [override the origin group](front-door-rules-engine-actions.md#RouteConfigurationOverride) for a request. The origin group set by the rule set overrides the routing process described in this article.
@@ -26,157 +26,158 @@ A *route* in Azure Front Door defines how traffic gets handled when the incoming
26
26
27
27
[!INCLUDE [Azure Front Door (classic) retirement notice](../../includes/front-door-classic-retirement.md)]
28
28
29
-
When a request arrives Azure Front Door (classic) edge, one of the first things that Front Door does is determine how to route the matching request to a backend resource and then take a defined action in the routing configuration. The following document explains how Front Door determines which route configuration to use when processing a request.
29
+
When a request arrives at the Azure Front Door (classic) edge, one of the first steps is to determine how to route the matching request to a backend resource and then take a defined action in the routing configuration. This document explains how Front Door determines which route configuration to use when processing a request.
30
30
31
31
::: zone-end
32
32
33
33
## Structure of a Front Door route configuration
34
34
35
-
A Front Door routing rule is composed of two major parts, the "left-hand side" and the "right-hand side". Front Door matches the incoming request to the left-hand side of the route while the right-hand side defines how the request gets processed.
35
+
A Front Door routing rule consists of two major parts: the "left-hand side" and the "right-hand side". Front Door matches the incoming request to the left-hand side of the route, while the right-hand side defines how the request is processed.
36
36
37
37
### Incoming match (left-hand side)
38
38
39
-
The following properties determine whether the incoming request matches the routing rule (or left-hand side):
39
+
The following properties determine whether the incoming request matches the routing rule (left-hand side):
40
40
41
41
***HTTP Protocols** - HTTP or HTTPS
42
42
***Domain** - For example: www\.foo.com, \*.bar.com
43
43
***Paths** - For example: /\*, /users/\*, /file.gif
44
44
45
-
These properties are expanded out internally so that every combination of Protocol/Domain/Path is a potential match set.
45
+
These properties are expanded internally so that every combination of Protocol/Domain/Path is a potential match set.
46
46
47
47
### Routing decision (right-hand side)
48
48
49
-
The decision of how to process the request depends on whether caching is enabled for the route. If a cached response isn't available, then the request is forwarded to the appropriate origin.
49
+
The decision on how to process the request depends on whether caching is enabled for the route. If a cached response isn't available, the request is forwarded to the appropriate origin.
50
50
51
51
## Route matching
52
52
53
-
This section focuses on how Front Door matches to a routing rule. The basic concept is that Front Door always matches to the **most-specific request**looking only at the "left-hand side". Front Door first matches based on protocol, then domain, and last the path.
53
+
This section explains how Front Door matches requests to routing rules. The basic principle is that Front Door always matches to the **most-specific request**by evaluating the "left-hand side" properties: protocol, domain, and path, in that order.
54
54
55
55
### Frontend host matching
56
56
57
-
Azure Front Door uses the following logic to match frontend hosts:
57
+
Azure Front Door uses the following steps to match frontend hosts:
58
58
59
-
1.Determine if there are any routes with an exact match on the frontend host.
60
-
2. If there are no exact frontend hosts match, the request get rejected and a 404: Bad Request error gets sent.
59
+
1.Check for routes with an exact match on the frontend host.
60
+
2. If no exact match is found, the request is rejected with a 404: Bad Request error.
61
61
62
-
The following tables show three different routing rules with frontend host and paths:
62
+
The following tables illustrate three different routing rules with their frontend hosts and paths:
63
63
64
-
| Routing rule | Frontend hosts | Path |
65
-
|--|--|--|
66
-
| A | foo.contoso.com | /\*|
67
-
| B | foo.contoso.com | /users/\*|
68
-
| C | www\.fabrikam.com, foo.adventure-works.com | /\*, /images/\*|
|www.northwindtraders.com| Error 404: Bad Request|
81
81
82
82
### Path matching
83
83
84
-
After Front Door determines the specific frontend host and filters for possible routing rules, Front Door then selects the routing rules based on the request path. A similar logic to frontend hosts is used to match the request path:
84
+
After determining the specific frontend host and filtering possible routing rules, Front Door selects the routing rules based on the request path. The following logic is used:
85
85
86
-
1.Determine if there are any routing rules with an exact match to the request path.
87
-
1. If there isn't an exact matching path, then Front Door looks for a routing rule with a wildcard path that matches.
88
-
1. If there are no routing rules found with a matching path, then request gets rejected and a 404: Bad Request error gets set sent.
86
+
1.Check for routing rules with an exact match to the request path.
87
+
2. If no exact match is found, look for a routing rule with a wildcard path that matches.
88
+
3. If no matching path is found, the request is rejected with a 404: Bad Request error.
89
89
90
90
::: zone pivot="front-door-standard-premium"
91
91
92
-
>[!NOTE]
93
-
> The wildcard character `*` is only valid for paths that don't have any other characters after it. Additionally, the wildcard character `*` must be preceded by a slash `/`. Paths without a wildcard are considered to be exact-match paths. A path that ends in a slash `/` is also an exact-match path. Ensure that your paths follow these rules to avoid any errors.
92
+
>[!NOTE]
93
+
> The wildcard character `*` is only valid for paths that don't have any other characters after it. Additionally, the wildcard character `*` must be preceded by a slash `/`. Paths without a wildcard are considered exact-match paths. A path that ends in a slash `/` is also an exact-match path. Ensure that your paths follow these rules to avoid errors.
94
94
95
95
::: zone-end
96
96
97
97
::: zone pivot="front-door-classic"
98
98
99
-
>[!NOTE]
100
-
> * Any paths without a wildcard are considered to be exact-match paths. If a path ends in a `/`, this is considered an exact match.
101
-
> * Patterns to match paths are case insensitive, meaning paths with different casings are treated as duplicates. For example, you have the same host using the same protocol with paths `/FOO` and `/foo`. These paths are considered duplicates which is not allowed in the Patterns to match setting.
102
-
>
99
+
> [!NOTE]
100
+
> * Paths without a wildcard are considered exact-match paths. A path ending with a `/` is also an exact match.
101
+
> * Path patterns are case insensitive. For example, `/FOO` and `/foo` are treated as duplicates and are not allowed in the Patterns to match setting.
103
102
104
103
::: zone-end
105
104
106
-
The following table is a list of routing rules, frontend host and path combination:
107
-
108
-
| Routing rule | Frontend host | Path |
109
-
|--|--|--|
110
-
| A | www\.contoso.com | / |
111
-
| B | www\.contoso.com | /\*|
112
-
| C | www\.contoso.com | /ab |
113
-
| D | www\.contoso.com | /abc |
114
-
| E | www\.contoso.com | /abc/ |
115
-
| F | www\.contoso.com | /abc/\*|
116
-
| G | www\.contoso.com | /abc/def|
117
-
| H | www\.contoso.com | /path/ |
118
-
119
-
The following table shows which routing rule the incoming request gets matched to when arriving at the Front Door edge:
120
-
121
-
| Incoming Request | Matched Route |
122
-
|--|--|
123
-
| www\.contoso.com/ | A |
124
-
| www\.contoso.com/a | B |
125
-
| www\.contoso.com/ab | C |
126
-
| www\.contoso.com/abc | D |
127
-
| www\.contoso.com/abzzz | B |
128
-
| www\.contoso.com/abc/ | E |
129
-
| www\.contoso.com/abc/d | F |
130
-
| www\.contoso.com/abc/def | G |
131
-
| www\.contoso.com/abc/defzzz| F |
132
-
| www\.contoso.com/abc/def/ghi| F |
133
-
| www\.contoso.com/path | B |
134
-
| www\.contoso.com/path/ | H |
135
-
| www\.contoso.com/path/zzz | B |
136
-
137
-
>[!WARNING]
138
-
> If there are no routing rules for an exact-match frontend host without a catch-all route path (/*), then no routing rule will be matched.
105
+
The following table lists routing rules with their frontend host and path combinations:
106
+
107
+
| Routing rule | Frontend host | Path|
108
+
|--------------|------------------|---------|
109
+
| A |www.contoso.com| /|
110
+
| B |www.contoso.com| /\*|
111
+
| C |www.contoso.com| /ab|
112
+
| D |www.contoso.com| /abc|
113
+
| E |www.contoso.com| /abc/|
114
+
| F |www.contoso.com| /abc/\*|
115
+
| G |www.contoso.com| /abc/def|
116
+
| H |www.contoso.com| /path/|
117
+
118
+
The table below shows which routing rule matches an incoming request at the Azure Front Door edge:
119
+
120
+
| Incoming Request | Matched Route |
121
+
|--------------------------|---------------|
122
+
|www.contoso.com/| A|
123
+
|www.contoso.com/a| B|
124
+
|www.contoso.com/ab| C|
125
+
|www.contoso.com/abc| D|
126
+
|www.contoso.com/abzzz| B|
127
+
|www.contoso.com/abc/| E|
128
+
|www.contoso.com/abc/d| F|
129
+
|www.contoso.com/abc/def| G|
130
+
|www.contoso.com/abc/defzzz| F|
131
+
|www.contoso.com/abc/def/ghi| F|
132
+
|www.contoso.com/path| B|
133
+
|www.contoso.com/path/| H|
134
+
|www.contoso.com/path/zzz| B|
135
+
136
+
>[!WARNING]
137
+
> If there are no routing rules for an exact-match frontend host without a catch-all route path (/*), no routing rule will be matched.
139
138
>
140
139
> Example configuration:
141
140
>
142
-
> | Route | Host | Path |
143
-
> |-------|------------------|---------|
141
+
> | Route | Host | Path |
142
+
> |-------|---------------------|---------|
144
143
> | A | profile.contoso.com | /api/\*|
145
144
>
146
145
> Matching table:
147
146
>
148
-
> | Incoming request | Matched Route |
149
-
> |------------------------|---------------|
147
+
> | Incoming request | Matched Route |
148
+
> |--------------------------|---------------|
150
149
> | profile.domain.com/other | None. Error 404: Bad Request |
151
150
152
151
### Routing decision
153
152
154
-
Once Front Door has matched to a single routing rule, it then needs to choose how to process the request. If your Azure Front Door has a cached response available for the matched routing rule, then the request gets served back to the client.
153
+
Once Azure Front Door matches a routing rule, it decides how to process the request. If a cached response is available, it is served back to the client.
155
154
156
155
::: zone pivot="front-door-standard-premium"
157
156
158
-
Lastly, Azure Front Door evaluates whether or not you have a [rule set](front-door-rules-engine.md) configured for the matched routing rule. If no rule set gets defined, then the request gets forwarded to the origin group without any changes. Otherwise, the rule sets get processed in the order configured. [Rule sets can override a route](front-door-rules-engine-actions.md#RouteConfigurationOverride) by forcing traffic to a specific origin group.
157
+
If a [rule set](front-door-rules-engine.md)is configured for the matched routing rule, it is processed in order. Rule sets can [override a route](front-door-rules-engine-actions.md#RouteConfigurationOverride) by directing traffic to a specific origin group. If no rule set is defined, the request is forwarded to the origin group without changes.
159
158
160
159
::: zone-end
161
160
162
161
::: zone pivot="front-door-classic"
163
162
164
-
If Front Door (classic) doesn't have a cached response for the matched routing rule, it evaluates whether [URL rewrite](front-door-url-rewrite.md)is configured for the matched routing rule. If there's no custom forwarding path, the request gets forwarded to the appropriate backend in the configured backend pool without changes. If a custom forwarding path has been defined, the request path gets updated as defined in [custom forwarding path](front-door-url-rewrite.md)and then gets forwarded to the backend.
163
+
If Azure Front Door (classic) doesn't have a cached response, it checks for a [URL rewrite](front-door-url-rewrite.md)configuration. If no custom forwarding path is defined, the request is forwarded to the appropriate backend in the configured backend pool. If a custom forwarding path is defined, the request path is updated accordingly and then forwarded to the backend.
165
164
166
165
::: zone-end
167
166
168
167
## Next steps
169
168
170
169
::: zone pivot="front-door-standard-premium"
171
170
172
-
-Learn how to [create an Azure Front Door](standard-premium/create-front-door-portal.md).
173
-
- Learn about [Azure Front Door routing architecture](front-door-routing-architecture.md).
171
+
-[Create an Azure Front Door](standard-premium/create-front-door-portal.md).
172
+
- Learn about the [Azure Front Door routing architecture](front-door-routing-architecture.md).
174
173
175
174
::: zone-end
176
175
177
176
::: zone pivot="front-door-classic"
178
177
179
-
- Learn how to [create an Azure Front Door (classic)](quickstart-create-front-door.md).
180
-
- Learn about [Azure Front Door routing architecture](front-door-routing-architecture.md).
178
+
-[Create an Azure Front Door (classic)](quickstart-create-front-door.md).
179
+
- Learn about the [Azure Front Door routing architecture](front-door-routing-architecture.md).
0 commit comments