Open Source API Gateway

map

Version

Syntax

rewriter-map:
from: <string> # required
to: <string> # required
do: rewrite
rewriter-map:
  from: <string> # required
  to: <string> # required
  do: rewrite

Attributes

NameRequiredDefaultDescriptionExamples
dofalserewrite, or redirect_temporary if to is an absolute URLrewrite 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
fromtrue-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/(.*)
totrue-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

Can be used in