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
+16-10Lines changed: 16 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ When you use [Rule set match conditions](rules-match-conditions.md), server vari
18
18
When you use [Rule set actions](front-door-rules-engine-actions.md), you can use server variables to dynamically change the request and response headers, and rewrite URLs, paths, and query strings, for example, when a new page load or when a form gets posted.
19
19
20
20
> [!NOTE]
21
-
> Server variables are available with Azure Front Door Standard and Premium tiers.
21
+
> Server variables are only available with Azure Front Door Standard and Premium tiers.
22
22
23
23
## Supported variables
24
24
@@ -54,16 +54,22 @@ When you work with Rule Set actions, specify server variables by using the follo
54
54
* Zero lengths: `{var:0:0}` = null, `{var:4:0}` = null
55
55
* 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
56
56
* To experiment with how {variable:offset:length} works, open a Linux bash terminal or use bash terminal in [Azure Cloud Shell](https://shell.azure.com/). Enter the following example into the terminal and examine the output to understand how the substring extraction behaves.
57
+
57
58
```azurecli-interactive
58
-
>>variable=helloworld123
59
-
>>echo ${variable:5}
60
-
world123
61
-
>>echo ${variable:0:4}
62
-
hell
63
-
>>echo ${variable: -3:3} # In bash, space comes before negative numbers.
variable=helloworld123; echo ${variable:5: -3} #Output = world
67
73
```
68
74
69
75
*`{url_path:seg#}`: Allow users to capture and use the desired URL path segment in URL Redirect, URL Rewrite, or any meaningful action. User 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:seg1}/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` results in `/12345/default/location/home`. Segment capture includes the location path, so if route is `/match/*`, segment 0 will be match.
0 commit comments