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/frontdoor/rule-set-server-variables.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ services: frontdoor
6
6
author: duongau
7
7
ms.service: frontdoor
8
8
ms.topic: conceptual
9
-
ms.date: 12/28/2023
9
+
ms.date: 05/07/2024
10
10
ms.author: duau
11
11
---
12
12
@@ -37,7 +37,7 @@ When you use [Rule set actions](front-door-rules-engine-actions.md), you can use
37
37
|`request_uri`| The full original request URI (with arguments).<br />For example, in the request `http://contoso.com:8080/article.aspx?id=123&title=fabrikam`, the `request_uri` value is `http://contoso.com:8080/article.aspx?id=123&title=fabrikam`.<br/> To access this server variable in a match condition, use [Request URL](rules-match-conditions.md?toc=%2fazure%2ffrontdoor%2fstandard-premium%2ftoc.json#request-url).|
38
38
|`ssl_protocol`| The protocol of an established TLS connection.<br/> To access this server variable in a match condition, use [SSL protocol](rules-match-conditions.md?toc=%2fazure%2ffrontdoor%2fstandard-premium%2ftoc.json#ssl-protocol).|
39
39
|`server_port`| The port of the server that accepted a request.<br/> To access this server variable in a match condition, use [Server port](rules-match-conditions.md?toc=%2fazure%2ffrontdoor%2fstandard-premium%2ftoc.json#server-port).|
40
-
|`url_path`| Identifies the specific resource in the host that the web client wants to access. This is the part of the request URI without the arguments or leading slash.<br />For example, in the request `http://contoso.com:8080/article.aspx?id=123&title=fabrikam`, the `url_path` value is `article.aspx`.<br/> To access this server variable in a match condition, use [Request path](rules-match-conditions.md?toc=%2fazure%2ffrontdoor%2fstandard-premium%2ftoc.json#request-path).|
40
+
|`url_path`| Identifies the specific resource in the host that the web client wants to access. This is the part of the request URI without the arguments or leading slash.<br />For example, in the request `http://contoso.com:8080/article.aspx?id=123&title=fabrikam`, the `url_path` value is `article.aspx`. <br /> AFD supports dynamic capture of URL path with `{url_path:seg#}` server vaiable and convert URL path to lowercase or uppercase with `{url_path.tolower}` or `{url_path.toupper}`. See details in [server variable](rule-set-server-variables.md). See details in Server variable format below. <br/> To access this server variable in a match condition, use [Request path](rules-match-conditions.md?toc=%2fazure%2ffrontdoor%2fstandard-premium%2ftoc.json#request-path).|
41
41
42
42
## Server variable format
43
43
@@ -51,6 +51,8 @@ When you work with Rule Set actions, specify server variables by using the follo
51
51
* Offsets and lengths within range: `{var:0:5}` = `AppId`, `{var:7:7}` = `1f59297`, `{var:7:-7}` = `1f592979c584d0f9d679db3e`
52
52
* Zero lengths: `{var:0:0}` = null, `{var:4:0}` = null
53
53
* Offsets within range and lengths out of range: `{var:0:100}` = `AppId=01f592979c584d0f9d679db3e66a3e5e`, `{var:5:100}` = `=01f592979c584d0f9d679db3e66a3e5e`, `{var:0:-48}` = null, `{var:4:-48}` = null
54
+
*`{url_path:seg#}`: allow users to capture and use the desired URL path segment in URL Redirect, URL Rewrite or any meaningful action. Customer can also capture multiple segments by using the same style as substring capture `{url_path:seg1:3}`. For example, for a source pattern `/id/12345/default` and a URL rewrite Destination `/{url_path:1}/home`, the expected URL path after rewrite is `/12345/home`. for a multiple segment capture, when the source pattern is `/id/12345/default/location/test`, a URL rewrite destination `/{url_path:seg1:3}/home` result in `/12345/default/location/home`. Note that segment capture will include the location path, so if route was `/match/*`, segment 0 will be match.
55
+
*`{url_path.tolower}`/`{url_path.toupper}`:convert the URL path to lowercase or uppercase. For example, a Destination `{url_path.tolower}` in URL rewrite/redirect for `/lowercase/ABcDXyZ/EXAMPLE` results in `/lowercase/abcdxyz/example`. A Destination `{url_path.toupper}` in URL rewrite/redirect for `/ABcDXyZ/example` results in `/ABCDXYZ/EXAMPLE`.
0 commit comments