monkeyDluffy6017 commented on code in PR #9194:
URL: https://github.com/apache/apisix/pull/9194#discussion_r1185204931
##########
docs/en/latest/plugins/proxy-rewrite.md:
##########
@@ -38,7 +38,7 @@ The `proxy-rewrite` Plugin rewrites Upstream proxy
information such as `scheme`,
|-----------------------------|---------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| uri | string | False | |
| New Upstream forwarding address.
Value supports [Nginx
variables](https://nginx.org/en/docs/http/ngx_http_core_module.html). For
example, `$arg_name`.
|
| method | string | False | | ["GET",
"POST", "PUT", "HEAD", "DELETE", "OPTIONS","MKCOL", "COPY", "MOVE", "PROPFIND",
"PROPFIND","LOCK", "UNLOCK", "PATCH", "TRACE"] | Rewrites the HTTP method.
|
-| regex_uri | array[string] | False | |
| New upstream forwarding address.
Regular expressions can be used to match the URL from client. If it matches,
the URL template is forwarded to the Upstream otherwise, the URL from the
client is forwarded. When both `uri` and `regex_uri` are configured, `uri` is
used first. For example, `[" ^/iresty/(.*)/(.*)/(.*)", "/$1-$2-$3"]`. Here, the
first element is the regular expression to match and the second element is the
URL template forwarded to the Upstream. |
+| regex_uri | array[string] | False | |
| Multiple regular expression and
substitute patterns. Regular expressions can be used to match the URL from
client. If it matches, the URL template is forwarded to the upstream.
Otherwise, the URL from the client is forwarded. When both `uri` and
`regex_uri` are configured, `uri` has a higher priority. It currently supports
multiple regular expressions for matching and substitution, apisix will iterate
all patterns until a successful match and substitution. For example,
`["^/iresty/(.*)/(.*)/(.*)", "/$1-$2-$3", ^/theothers/(.*)/(.*)",
"/theothers/$1-$2"]`. Here, the odd index elements are the regular expressions
to match, the even index elements are the URL templates forwarded to the
Upstream. Length of this property must be a even number. |
Review Comment:
| regex_uri | array[string] | False | |
| Regular expressions can be
used to match the URL from client. If it matches, the URL template is forwarded
to the upstream. Otherwise, the URL from the client is forwarded. When both
`uri` and `regex_uri` are configured, `uri` has a higher priority. Multiple
regular expressions are currently supported for pattern matching, and the
plugin will try to match them one by one until they succeed or all fail. For
example: `["^/iresty/(. *)/(. *)/(. *)", "/$1-$2-$3", ^/theothers/(. *)/(. *)",
"/theothers/$1-$2"]`, the element with the odd index represents the `uri`
regular expression that matches the request from the client, and the element
with the even index represents the `uri` template that is forwarded upstream
upon a successful match. Please note that the length of this value must
be an **even number** |
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]