You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/10/11 07:34:43 UTC

[GitHub] [apisix] Hazel6869 commented on a diff in pull request #8069: docs: update proxy_rewrite doc

Hazel6869 commented on code in PR #8069:
URL: https://github.com/apache/apisix/pull/8069#discussion_r991916387


##########
docs/zh/latest/plugins/proxy-rewrite.md:
##########
@@ -38,7 +38,7 @@ description: 本文介绍了关于 Apache APISIX `proxy-rewrite` 插件的基本
 | scheme    | string        | 否    | "http"  | ["http", "https"]                                                                                                                      | 不推荐使用。应该在 Upstream 的 `scheme` 字段设置上游的 `scheme`。|
 | 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` 模板。但是目前我们只支持一个regex_uri,所以regex_uri数组的长度是2。 |

Review Comment:
   Thanks, I have changed.



##########
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. We only support one regex_uri currently, so the length of the regex_uri array is 2. |

Review Comment:
   > 
   
   Thanks, I have changed.



-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org