Skip to content

Commit d94e430

Browse files
committed
freshness review
1 parent afd794f commit d94e430

File tree

1 file changed

+82
-81
lines changed

1 file changed

+82
-81
lines changed

articles/frontdoor/front-door-route-matching.md

Lines changed: 82 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services: front-door
66
author: duongau
77
ms.service: azure-frontdoor
88
ms.topic: conceptual
9-
ms.date: 12/04/2023
9+
ms.date: 11/13/2024
1010
ms.author: duau
1111
zone_pivot_groups: front-door-tiers
1212
---
@@ -15,7 +15,7 @@ zone_pivot_groups: front-door-tiers
1515

1616
::: zone pivot="front-door-standard-premium"
1717

18-
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.
1919

2020
> [!NOTE]
2121
> 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
2626

2727
[!INCLUDE [Azure Front Door (classic) retirement notice](../../includes/front-door-classic-retirement.md)]
2828

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.
3030

3131
::: zone-end
3232

3333
## Structure of a Front Door route configuration
3434

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.
3636

3737
### Incoming match (left-hand side)
3838

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):
4040

4141
* **HTTP Protocols** - HTTP or HTTPS
4242
* **Domain** - For example: www\.foo.com, \*.bar.com
4343
* **Paths** - For example: /\*, /users/\*, /file.gif
4444

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.
4646

4747
### Routing decision (right-hand side)
4848

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.
5050

5151
## Route matching
5252

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.
5454

5555
### Frontend host matching
5656

57-
Azure Front Door uses the following logic to match frontend hosts:
57+
Azure Front Door uses the following steps to match frontend hosts:
5858

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.
6161

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:
6363

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/\* |
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/\* |
6969

70-
The following table shows the matching results for the above routing rules:
70+
The table below shows the matching results for the above routing rules:
7171

72-
| Incoming frontend host | Matched routing rule(s) |
73-
|--|--|
74-
| foo.contoso.com | A, B |
75-
| www\.fabrikam.com | C |
76-
| images.fabrikam.com | Error 404: Bad Request |
77-
| foo.adventure-works.com | C |
78-
| contoso.com | Error 404: Bad Request |
79-
| www\.adventure-works.com | Error 404: Bad Request |
80-
| www\.northwindtraders.com | Error 404: Bad Request |
72+
| Incoming frontend host | Matched routing rule(s) |
73+
|--------------------------|-------------------------|
74+
| foo.contoso.com | A, B |
75+
| www.fabrikam.com | C |
76+
| images.fabrikam.com | Error 404: Bad Request |
77+
| foo.adventure-works.com | C |
78+
| contoso.com | Error 404: Bad Request |
79+
| www.adventure-works.com | Error 404: Bad Request |
80+
| www.northwindtraders.com | Error 404: Bad Request |
8181

8282
### Path matching
8383

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:
8585

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.
8989

9090
::: zone pivot="front-door-standard-premium"
9191

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.
9494
9595
::: zone-end
9696

9797
::: zone pivot="front-door-classic"
9898

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.
103102
104103
::: zone-end
105104

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.
139138
>
140139
> Example configuration:
141140
>
142-
> | Route | Host | Path |
143-
> |-------|------------------|---------|
141+
> | Route | Host | Path |
142+
> |-------|---------------------|---------|
144143
> | A | profile.contoso.com | /api/\* |
145144
>
146145
> Matching table:
147146
>
148-
> | Incoming request | Matched Route |
149-
> |------------------------|---------------|
147+
> | Incoming request | Matched Route |
148+
> |--------------------------|---------------|
150149
> | profile.domain.com/other | None. Error 404: Bad Request |
151150
152151
### Routing decision
153152

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.
155154

156155
::: zone pivot="front-door-standard-premium"
157156

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.
159158

160159
::: zone-end
161160

162161
::: zone pivot="front-door-classic"
163162

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.
165164

166165
::: zone-end
167166

168167
## Next steps
169168

170169
::: zone pivot="front-door-standard-premium"
171170

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).
174173

175174
::: zone-end
176175

177176
::: zone pivot="front-door-classic"
178177

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).
180+
181+
::: zone-end
181182

182183
::: zone-end

0 commit comments

Comments
 (0)