Syntax
rewriter-map:
from: <string> # required
to: <string> # required
do: rewriterewriter-map: from: <string> # required to: <string> # required do: rewrite
Attributes
| Name | Required | Default | Description | Examples |
|---|---|---|---|---|
| do | false | rewrite, or redirect_temporary if to is an absolute URL | rewrite changes the request and passes it on. redirect_temporary (307) and redirect_permanent (301) answer with the new location without calling the backend. | redirect_permanent |
| from | true | - | Java regular expression searched in the path and query of the request. It is not anchored: use ^ to match from the start of the path. | ^/store/(.*) |
| to | true | - | Replacement for the matched part. $1, $2, ... insert the groups captured by from. An absolute URL such as https://example.com/$1 redirects by default; with do: rewrite it replaces the backend instead, if the target URL has no path or only /. A target URL with a longer path is always called as configured. A redirect goes to the host of the request or to the scheme and host written in to: a request whose captured groups, or the part of the path in front of a match without ^, would change them, e.g. into //example.com/, is answered with 400. | /shop/v2/$1 |