Parameters
See plugin common configurations for configuration options available to all plugins.
uri
New upstream URI path. Value could be a built-in variable.
method
vaild vaule:
GET,POST,PUT,HEAD,DELETE,OPTIONS,MKCOL,COPY,MOVE,PROPFIND,LOCK,UNLOCK,PATCH, orTRACEHTTP method to rewrite requests to use.
regex_uri
Regular expressions used to match the URI path from client requests and compose a new upstream URI path. When both
uriandregex_uriare configured,urihas a higher priority. The array should contain one or more key-value pairs, with the key being the regular expression to match URI against and value being the new upstream URI path.For example, with
["^/iresty/(. *)/(. *)", "/$1-$2", ^/theothers/*", "/theothers"], if a request is originally sent to/iresty/hello/world, the plugin will rewrite the upstream URI path to/iresty/hello-world; if a request is originally sent to/theothers/hello/world, the plugin will rewrite the upstream URI path to/theothers.set_ngx_uri
The parameter is currently only available in API7 Enterprise and will be updated to APISIX soon.
If false, the value of
ngx.var.uriwill remain unchanged, preserving the original routeuri. If true,ngx.var.uriwill be updated to theurivalue specified inproxy-rewrite.host
Set
Hostrequest header.headers
Header actions to be executed. Can be set to objects of action verbs
add,remove, and/orset; or an object consisting of headers to beset.When multiple action verbs are configured, actions are executed in the order of
add,remove, andset.add
Headers to append to requests. If a header is already present in the request, the header value will be appended. Header value could be set to a constant, one or more built-in variables, or the matched result of
regex_uriusing variables such as$1-$2-$3.A header value can also be an array of values, which appends one header line per value instead of a single comma-joined line. Available in API7 Enterprise from version 3.9.17 on the 3.9 line and from version 3.10.4 on the 3.10 line.
set
Headers to set to requests. If a header is already present in the request, the header value will be overwritten. Header value could be set to a constant, one or more built-in variables, or the matched result of
regex_uriusing variables such as$1-$2-$3.A header value can also be an array of values, which sends one header line per value instead of a single comma-joined line. Available in API7 Enterprise from version 3.9.17 on the 3.9 line and from version 3.10.4 on the 3.10 line.
Should not be used to set
Host.remove
Headers to remove from requests.
use_real_request_uri_unsafe
If true, bypass URI normalization and allow for the full original request URI. Enabling this option is considered unsafe.