This is an automated email from the ASF dual-hosted git repository.
sylviasu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new 91ac6fd70 docs: update proxy_rewrite doc about the describe of
regex_uri (#8069)
91ac6fd70 is described below
commit 91ac6fd704da764b4492b6013e9d41ac45e2908f
Author: chengxiaolan <[email protected]>
AuthorDate: Fri Oct 14 09:25:45 2022 +0800
docs: update proxy_rewrite doc about the describe of regex_uri (#8069)
* fix proxy_rewrite doc
* fix docs
* fix docs
---
docs/en/latest/plugins/redirect.md | 16 ++++++++--------
docs/zh/latest/plugins/proxy-rewrite.md | 2 +-
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/docs/en/latest/plugins/redirect.md
b/docs/en/latest/plugins/redirect.md
index a3a7333e7..4e55bad5b 100644
--- a/docs/en/latest/plugins/redirect.md
+++ b/docs/en/latest/plugins/redirect.md
@@ -32,14 +32,14 @@ The `redirect` Plugin can be used to configure redirects.
## Attributes
-| Name | Type | Required | Default | Valid values |
Description
|
-|---------------------|---------------|----------|---------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| http_to_https | boolean | False | false | |
When set to `true` and the request is HTTP, it will be redirected to HTTPS with
the same URI with a 301 status code. Note the querystring from the raw URI
will also be contained in the Location header.
[...]
-| uri | string | False | | |
URI to redirect to. Can contain Nginx variables. For example,
`/test/index.html`, `$uri/index.html`, `${uri}/index.html`. If you refer to a
variable name that doesn't exist, instead of throwing an error, it will treat
it as an empty variable.
|
-| regex_uri | array[string] | False | | |
Match the URL from client with a regular expression and redirect. If it doesn't
match, the request will be forwarded to the Upstream. Only either of `uri` or
`regex_uri` can be used at a time. For example, [" ^/iresty/(.*)/(.*)/(.*)",
"/$1-$2-$3"], where the first element is the regular expression to match and
the second element is the URI to redirect to. |
-| ret_code | integer | False | 302 | [200, ...] |
HTTP response code.
|
-| encode_uri | boolean | False | false | |
When set to `true` the URI in the `Location` header will be encoded as per
[RFC3986](https://datatracker.ietf.org/doc/html/rfc3986).
|
-| append_query_string | boolean | False | false | |
When set to `true`, adds the query string from the original request to the
`Location` header. If the configured `uri` or `regex_uri` already contains a
query string, the query string from the request will be appended to it with an
`&`. Do not use this if you have already handled the query string (for example,
with an Nginx variable `$request_uri`) to avoid duplicates. |
+| Name | Type | Required | Default | Valid values |
Description
[...]
+|---------------------|---------------|----------|---------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
+| http_to_https | boolean | False | false | |
When set to `true` and the request is HTTP, it will be redirected to HTTPS with
the same URI with a 301 status code. Note the querystring from the raw URI
will also be contained in the Location header.
[...]
+| uri | string | False | | |
URI to redirect to. Can contain Nginx variables. For example,
`/test/index.html`, `$uri/index.html`, `${uri}/index.html`. If you refer to a
variable name that doesn't exist, instead of throwing an error, it will treat
it as an empty variable.
[...]
+| regex_uri | array[string] | False | | |
Match the URL from client with a regular expression and redirect. If it doesn't
match, the request will be forwarded to the Upstream. Only either of `uri` or
`regex_uri` can be used at a time. For example, [" ^/iresty/(.*)/(.*)/(.*)",
"/$1-$2-$3"], where the first element is the regular expression to match and
the second element is the URI to redirect to. APISIX only support one
`regex_uri` currently, so the leng [...]
+| ret_code | integer | False | 302 | [200, ...] |
HTTP response code.
[...]
+| encode_uri | boolean | False | false | |
When set to `true` the URI in the `Location` header will be encoded as per
[RFC3986](https://datatracker.ietf.org/doc/html/rfc3986).
[...]
+| append_query_string | boolean | False | false | |
When set to `true`, adds the query string from the original request to the
`Location` header. If the configured `uri` or `regex_uri` already contains a
query string, the query string from the request will be appended to it with an
`&`. Do not use this if you have already handled the query string (for example,
with an Nginx variable `$request_uri`) to avoid duplicates.
[...]
:::note
diff --git a/docs/zh/latest/plugins/proxy-rewrite.md
b/docs/zh/latest/plugins/proxy-rewrite.md
index 164b7833a..2b1d0e2a4 100644
--- a/docs/zh/latest/plugins/proxy-rewrite.md
+++ b/docs/zh/latest/plugins/proxy-rewrite.md
@@ -37,7 +37,7 @@ description: 本文介绍了关于 Apache APISIX `proxy-rewrite` 插件的基本
| --------- | ------------- | ----- | ------- |
---------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| uri | string | 否 | |
| 转发到上游的新 `uri` 地址。支持 [NGINX
variables](https://nginx.org/en/docs/http/ngx_http_core_module.html)
变量,例如:`$arg_name`。 |
| method | string | 否 | | ["GET", "POST", "PUT", "HEAD",
"DELETE", "OPTIONS","MKCOL", "COPY", "MOVE", "PROPFIND", "PROPFIND","LOCK",
"UNLOCK", "PATCH", "TRACE"] | 将路由的请求方法代理为该请求方法。 |
-| regex_uri | array[string] | 否 | |
| 转发到上游的新 `uri` 地址。使用正则表达式匹配来自客户端的
`uri`,如果匹配成功,则使用模板替换转发到上游的 `uri`,如果没有匹配成功,则将客户端请求的 `uri` 转发至上游。当同时配置 `uri` 和
`regex_uri` 属性时,优先使用 `uri`。例如:["^/iresty/(.*)/(.*)/(.*)","/$1-$2-$3"]
第一个元素代表匹配来自客户端请求的 `uri` 正则表达式,第二个元素代表匹配成功后转发到上游的 `uri` 模板。 |
+| regex_uri | array[string] | 否 | |
| 转发到上游的新 `uri` 地址。使用正则表达式匹配来自客户端的
`uri`,如果匹配成功,则使用模板替换转发到上游的 `uri`,如果没有匹配成功,则将客户端请求的 `uri` 转发至上游。当同时配置 `uri` 和
`regex_uri` 属性时,优先使用 `uri`。例如:["^/iresty/(.*)/(.*)/(.*)","/$1-$2-$3"]
第一个元素代表匹配来自客户端请求的 `uri` 正则表达式,第二个元素代表匹配成功后转发到上游的 `uri` 模板。但是目前 APISIX 仅支持一个
`regex_uri`,所以 `regex_uri` 数组的长度是 `2`。 |
| host | string | 否 | | | 转发到上游的新
`host` 地址,例如:`iresty.com`。|
| headers | object | 否 | | | 转发到上游的新
`headers`,可以设置多个。如果 header 存在将进行重写,如果不存在则会添加到 header 中。如果你想要删除某个
header,请把对应的值设置为空字符串即可。支持使用 NGINX 的变量,例如 `client_addr` 和`$remote_addr`。|