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
Copy file name to clipboardExpand all lines: articles/application-gateway/rewrite-http-headers-url.md
+2-19Lines changed: 2 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,8 @@ You can use rewrite conditions to evaluate the content of HTTP(S) requests and r
72
72
1. Re-evaluate path map: Specify if the URL path map must be re-evaluated after rewrite. If kept unchecked, the original URL path will be used to match the path-pattern in the URL path map. If set to true, the URL path map will be re-evaluated to check the match with the rewritten path. Enabling this switch helps in routing the request to a different backend pool post rewrite.
73
73
Application Gateway uses regular expressions for pattern matching in the condition. You should use Regular Expression 2 (RE2) compatible expressions when writing your conditions. If you're running an Application Gateway Web Application Firewall (WAF) with Core Rule Set 3.1 or earlier, you might have issues when using [Perl Compatible Regular Expressions (PCRE)](https://www.pcre.org/). Issues can happen when using lookahead and lookbehind (negative or positive) assertions.
74
74
75
-
## Pattern matching and Capturing
75
+
## Pattern matching and capturing
76
+
76
77
Patten matching and capturing are supported under Condition and Action (under Action, it is supported only for a specific header).
77
78
78
79
### Pattern matching
@@ -281,24 +282,6 @@ In that case, Application Gateway can capture parameters from the URL and add qu
281
282
282
283
For a step-by-step guide to achieve the scenario described above, see [Rewrite URL with Application Gateway using Azure portal](rewrite-url-portal.md)
283
284
284
-
285
-
## Rewrite configuration common pitfalls
286
-
287
-
* Enabling 'Re-evaluate path map' isn't allowed for basic request routing rules. This is to prevent infinite evaluation loop for a basic routing rule.
288
-
289
-
* There needs to be at least 1 conditional rewrite rule or 1 rewrite rule which doesn't have 'Re-evaluate path map' enabled for path-based routing rules to prevent infinite evaluation loop for a path-based routing rule.
290
-
291
-
* Incoming requests would be terminated with a 500 error code in case a loop is created dynamically based on client inputs. The Application Gateway will continue to serve other requests without any degradation in such a scenario.
292
-
293
-
### Using URL rewrite or Host header rewrite with Web Application Firewall (WAF_v2 SKU)
294
-
295
-
When you configure URL rewrite or host header rewrite, the WAF evaluation will happen after the modification to the request header or URL parameters (post-rewrite). And when you remove the URL rewrite or host header rewrite configuration on your Application Gateway, the WAF evaluation will be done before the header rewrite (pre-rewrite). This order ensures that WAF rules are applied to the final request that would be received by your backend pool.
296
-
297
-
For example, say you have the following header rewrite rule for the header `"Accept" : "text/html"` - if the value of header `"Accept"` is equal to `"text/html"`, then rewrite the value to `"image/png"`.
298
-
299
-
Here, with only header rewrite configured, the WAF evaluation will be done on `"Accept" : "text/html"`. But when you configure URL rewrite or host header rewrite, then the WAF evaluation will be done on `"Accept" : "image/png"`.
300
-
301
-
302
285
## URL rewrite vs URL redirect
303
286
304
287
For a URL rewrite, Application Gateway rewrites the URL before the request is sent to the backend. This won't change what users see in the browser because the changes are hidden from the user.
Copy file name to clipboardExpand all lines: articles/application-gateway/rewrite-url-portal.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ services: application-gateway
5
5
author: greg-lindsay
6
6
ms.service: azure-application-gateway
7
7
ms.topic: how-to
8
-
ms.date: 4/05/2021
8
+
ms.date: 10/22/2024
9
9
ms.author: greglin
10
10
---
11
11
@@ -72,7 +72,7 @@ In the below example whenever the request URL contains */article*, the URL path
72
72
73
73
f. Enter a regular expression pattern. In this example, we'll use the pattern `.*article/(.*)/(.*)`
74
74
75
-
( ) is used to capture the substring for later use in composing the expression for rewriting the URL path. For more information, see [here](rewrite-http-headers-url.md#capturing).
75
+
( ) is used to capture the substring for later use in composing the expression for rewriting the URL path. For more information, see [Pattern matching and capturing](rewrite-http-headers-url.md#pattern-matching-and-capturing).
0 commit comments