Skip to content

Commit e3ee565

Browse files
committed
edits
1 parent 1e21364 commit e3ee565

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

articles/application-gateway/parameter-based-path-selection-portal.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ If you don't have an Azure subscription, create a [free account](https://azure.m
1717

1818
## Before you begin
1919

20-
You need to have an Application Gateway v2 SKU instance to complete the steps in this article. URL rewrite and rewriting headers isn't supported in the v1 SKU. If you don't have the v2 SKU, create an [Application Gateway v2 SKU](./tutorial-autoscale-ps.md) instance before you begin.
20+
You need to have an Application Gateway v2 SKU instance to complete the steps in this article. URL rewrite and rewriting headers aren't supported in the v1 SKU. If you don't have the v2 SKU, create an [Application Gateway v2 SKU](./tutorial-autoscale-ps.md) instance before you begin.
2121

2222

2323
## Sign in to Azure
@@ -28,9 +28,9 @@ Sign in to the [Azure portal](https://portal.azure.com/) with your Azure account
2828

2929
For this example, you have a shopping website and the product category is passed as query string in the URL, and you want to route the request to backend based on the query string, then:
3030

31-
**Step 1:** Create a path-map as shown in the image below
31+
**Step 1:** Create a path-map as shown in the following image:
3232

33-
:::image type="content" source="./media/rewrite-http-headers-url/url-scenario1-1.png" alt-text="URL rewrite scenario 1-1.":::
33+
:::image type="content" source="./media/rewrite-http-headers-url/url-scenario1-1.png" alt-text="A screenshot of URL rewrite scenario 1-1.":::
3434

3535
**Step 2 (a):** Create a rewrite set which has 3 rewrite rules:
3636

@@ -40,17 +40,16 @@ For this example, you have a shopping website and the product category is passed
4040

4141
* The third rule has a condition that checks the *query_string* variable for *category=accessories* and has an action that rewrites the URL path to /*listing3* and has **Reevaluate path map** enabled
4242

43-
:::image type="content" source="./media/rewrite-http-headers-url/url-scenario1-2.png" alt-text="URL rewrite scenario 1-2.":::
43+
:::image type="content" source="./media/rewrite-http-headers-url/url-scenario1-2.png" alt-text="A screenshow of URL rewrite scenario 1-2.":::
4444

4545

46+
**Step 2 (b):** Associate this rewrite set with the default path of the previous path-based rule:
4647

47-
**Step 2 (b):** Associate this rewrite set with the default path of the above path-based rule
48+
:::image type="content" source="./media/rewrite-http-headers-url/url-scenario1-3.png" alt-text="A screenshot of URL rewrite scenario 1-3.":::
4849

49-
:::image type="content" source="./media/rewrite-http-headers-url/url-scenario1-3.png" alt-text="URL rewrite scenario 1-3.":::
50+
If the user requests *contoso.com/listing?category=any*, then it's matched with the default path since none of the path patterns in the path map (/listing1, /listing2, /listing3) are matched. Since you associated the previous rewrite set with this path, this rewrite set is evaluated. Because the query string doesn't match the condition in any of the 3 rewrite rules in this rewrite set, no rewrite action takes place. Therefore, the request is routed unchanged to the backend associated with the default path (which is *GenericList*).
5051

51-
If the user requests *contoso.com/listing?category=any*, then it's matched with the default path since none of the path patterns in the path map (/listing1, /listing2, /listing3) are matched. Since you associated the previous rewrite set with this path, this rewrite set is evaluated. Because the query string won't match the condition in any of the 3 rewrite rules in this rewrite set, no rewrite action takes place. Therefore, the request is routed unchanged to the backend associated with the default path (which is *GenericList*).
52-
53-
If the user requests *contoso.com/listing?category=shoes*, then the default path is matched. However, in this case the condition in the first rule matches. Therefore, the action associated with the condition is executed, which rewrites the URL path to /*listing1* and reevaluates the path-map. When the path-map is reevaluated, the request matches the path associated with pattern */listing1* and the request is routed to the backend associated with this pattern (ShoesListBackendPool).
52+
If the user requests *contoso.com/listing?category=shoes*, then the default path is matched. However, in this case, the condition in the first rule matches. Therefore, the action associated with the condition is executed, which rewrites the URL path to /*listing1* and reevaluates the path-map. When the path-map is reevaluated, the request matches the path associated with pattern */listing1* and the request is routed to the backend associated with this pattern (ShoesListBackendPool).
5453

5554
> [!NOTE]
5655
> This scenario can be extended to any header or cookie value, URL path, query string or server variables based on the conditions defined and essentially enables you to route requests based on those conditions.

articles/application-gateway/rewrite-http-headers-url.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Here are the steps for replacing the hostname:
203203
1. Create a rewrite rule with a condition that evaluates if the location header in the response contains azurewebsites.net. Enter the pattern `(https?):\/\/.*azurewebsites\.net(.*)$`.
204204
2. Perform an action to rewrite the location header so that it has the application gateway's hostname. Do this by entering `{http_resp_Location_1}://contoso.com{http_resp_Location_2}` as the header value. Alternatively, you can also use the server variable `host` to set the hostname to match the original request.
205205

206-
![A screenshow of the modify location header action.](./media/rewrite-http-headers-url/app-service-redirection.png)
206+
![A screenshow of the modify location header action.](./media/rewrite-http-headers-url/app-service-redirection.png)
207207

208208
#### Implement security HTTP headers to prevent vulnerabilities
209209

@@ -231,11 +231,11 @@ You can evaluate an HTTP request or response header for the presence of a header
231231

232232
To accomplish scenarios where you want to choose the backend pool based on the value of a header, part of the URL, or query string in the request, you can use a combination of URL Rewrite capability and path-based routing.
233233

234-
To do this, you have to create a rewrite set with a condition that checks for a specific parameter (query string, header, etc.) and then performs an action where it changes the URL path (ensure **Reevaluate path map** is enabled). The rewrite set must then be associated to a path based rule. The path based rule must contain the same URL paths specified in the rewrite set and their corresponding backend pool.
234+
To do this, create a rewrite set with a condition that checks for a specific parameter (query string, header, etc.) and then performs an action where it changes the URL path (ensure **Reevaluate path map** is enabled). The rewrite set must then be associated to a path based rule. The path based rule must contain the same URL paths specified in the rewrite set and their corresponding backend pool.
235235

236236
Thus, the rewrite set allows users to check for a specific parameter and assign it a new path, and the path based rule allows users to assign backend pools to those paths. As long as "Reevaluate path map" is enabled, traffic routs based on the path specified in the rewrite set.
237237

238-
For a use case example using query strings, please see [Route traffic using parameter based path selection in portal](parameter-based-path-selection-portal.md).
238+
For a use case example using query strings, see [Route traffic using parameter based path selection in portal](parameter-based-path-selection-portal.md).
239239

240240

241241
#### Rewrite query string parameters based on the URL

0 commit comments

Comments
 (0)