juzhiyuan commented on code in PR #6891:
URL: https://github.com/apache/apisix/pull/6891#discussion_r857443879


##########
docs/zh/latest/plugins/grpc-transcode.md:
##########
@@ -23,20 +29,40 @@ title: grpc-transcode
 
 ## 描述
 
-HTTP(s) -> APISIX -> gRPC server
+使用 `grpc-transcode` 插件可以在 HTTP 和 gRPC 请求之间进行转换。
 
-## Proto
+APISIX 接收 HTTP 请求后,首先对请求进行转码,并将转码后的请求转发到 gRPC 服务,获取响应并以 HTTP 格式将其返回给客户端。
 
-### 参数
+<!-- TODO: use an image here to explain the concept better -->

Review Comment:
   Do you have a specific image?



##########
docs/zh/latest/plugins/response-rewrite.md:
##########
@@ -23,39 +29,47 @@ title: response-rewrite
 
 ## 描述
 
-该插件支持修改上游服务或网关本身返回的 body 和 header 信息。
+`response-rewrite` 插件支持修改上游服务或 APISIX 返回的 Body 和 Header 信息。
 
-使用场景:
+该插件可以应用在以下场景中:
 
-1. 可以设置 `Access-Control-Allow-*` 等 header 信息,来实现 CORS(跨域资源共享)的功能。
+- 通过设置 `Access-Control-Allow-*` 字段实现 CORS(跨域资源共享)的功能。
+- 通过设置标头中的 `status_code` 和 `Location` 字段实现重定向。
 
-2. 另外也可以通过配置 status_code 和 header 里面的 Location 来实现重定向,当然如果只是需要重定向功能,最好使用 
[redirect](redirect.md) 插件。
+:::tip
+
+如果你仅需要重定向功能,建议使用 [redirect](redirect.md) 插件。
+
+:::
 
 ## 属性
 
 | 名称              | 类型      | 必选项 | 默认值    | 有效值             | 描述              
                                                                                
                                                               |
 
|-----------------|---------|-----|--------|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| status_code     | integer | 可选  |        | [200, 598]      | 
修改上游返回状态码,默认保留原始响应代码。                                                           
                                                                               |
-| body            | string  | 可选  |        |                 | 修改上游返回的 `body` 
内容,如果设置了新内容,header 里面的 content-length 字段也会被去掉。                                  
                                                                |
-| body_base64     | boolean | 可选  | false  |                 | 描述 `body` 
字段是否需要 base64 解码之后再返回给客户端,用在某些图片和 Protobuffer 场景。                               
                                                                     |
-| headers         | object  | 可选  |        |                 | 返回给客户端的 
`headers`,这里可以设置多个。头信息如果存在将重写,不存在则添加。想要删除某个 header 的话,把对应的值设置为空字符串即可。这个值能够以 
`$var` 的格式包含 Nginx 变量,比如 `$remote_addr $balancer_ip`。                      |
-| vars            | array[] | 可选  |        |                 | `vars` 
是一个表达式列表,只有满足条件的请求和响应才会修改 body 和 header 信息,来自 
[lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list)。如果 
`vars` 字段为空,那么所有的重写动作都会被无条件的执行。 |
-| filters         | array[] | 可选  |        |                 | 
一组过滤器,采用指定字符串表达式修改响应体。                                                          
                                                                               |
-| filters.regex   | string  | 必选  |        |                 | 用于匹配响应体正则表达式。   
                                                                                
                                                               |
-| filters.scope   | string  | 可选  | "once" | "once","global" | 替换范围,"once" 表达式 
`filters.regex` 仅替换首次匹配上响应体的内容,"global" 则进行全局替换。                                
                                                               |
-| filters.replace | string  | 必选  |        |                 | 替换后的内容。         
                                                                                
                                                               |
-| filters.options | string  | 可选  | "jo"   |                 | 正则匹配有效参数,可选项见 
[ngx.re.match](https://github.com/openresty/lua-nginx-module#ngxrematch)。       
                                                                 |
+| status_code     | integer | 否  |        | [200, 598]      | 
修改上游返回状态码,默认保留原始响应代码。                                                           
                                                                               |
+| body            | string  | 否  |        |                 | 修改上游返回的 `body` 
内容,如果设置了新内容,header 里面的 content-length 字段也会被去掉。                                  
                                                                |
+| body_base64     | boolean | 否  | false  |                 | 描述 `body` 字段是否需要 
base64 解码之后再返回给客户端,用在某些图片和 Protobuffer 场景。                                      
                                                              |
+| headers         | object  | 否  |        |                 | 返回给客户端的 
`headers`,这里可以设置多个。头信息如果存在将重写,不存在则添加。想要删除某个 header 的话,把对应的值设置为空字符串即可。这个值能够以 
`$var` 的格式包含 NGINX 变量,比如 `$remote_addr $balancer_ip`。                      |
+| vars            | array[] | 否  |        |                 | `vars` 
是一个表达式列表,只有满足条件的请求和响应才会修改 body 和 header 信息,来自 
[lua-resty-expr](https://github.com/api7/lua-resty-expr#operator-list)。如果 
`vars` 字段为空,那么所有的重写动作都会被无条件的执行。 |
+| filters         | array[] | 否  |        |                 | 
一组过滤器,采用指定字符串表达式修改响应体。                                                          
                                                                               |
+| filters.regex   | string  | 是  |        |                 | 用于匹配响应体正则表达式。    
                                                                                
                           |
+| filters.scope   | string  | 否  | "once" | "once","global" | 替换范围,"once" 表达式 
`filters.regex` 仅替换首次匹配上响应体的内容,"global" 则进行全局替换。                                
                                                               |
+| filters.replace | string  | 是  |        |                 | 替换后的内容。          
                                                                                
                                                              |
+| filters.options | string  | 否  | "jo"   |                 | 正则匹配有效参数,可选项见 
[ngx.re.match](https://github.com/openresty/lua-nginx-module#ngxrematch)。       
                                                                                
                    |
 
-`body` 和 `filters`,两个只能配置其中一个。
+:::note
 
-## 示例
+`body` 和 `filters`属性只能配置其中一个。

Review Comment:
   ```suggestion
   `body` 和 `filters` 属性只能配置其中一个。
   ```



-- 
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]

Reply via email to