arabot777 opened a new issue #5370:
URL: https://github.com/apache/apisix/issues/5370


   ### Issue description
   
   The response-rewrite sample was configured according to the [official 
document](https://apisix.apache.org/docs/apisix/plugins/response-rewrite/#how-to-enable),
  but the returned content was found not to be modified as expected when the 
curl xxxxx. 
   After many tests, the plugin took effect after changing apisix-openresty 
**back to** openresty.
   
   ### Environment
   
   - apisix version (cmd: `apisix version`): 2.10.0/2.10.1
   - OS (cmd: `uname -a`):Linux localhost.localdomain 
3.10.0-957.10.1.el7.x86_64   2019 x86_64 x86_64 x86_64 GNU/Linux
   - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
   apisix-openresty:openresty/1.19.3.2
   openresty:openresty/1.19.3.1 (or 1.19.19.1)
   
   - etcd version, if have (cmd: run `curl 
http://127.0.0.1:9090/v1/server_info` to get the info from server-info API): 
3.4.0
   - apisix-dashboard version, if have:
   - the plugin runner version, if the issue is about a plugin runner (cmd: 
depended on the kind of runner):
   - luarocks version, if the issue is about installation (cmd: `luarocks 
--version`):
   /bin/luarocks 2.3.0
   
   ### Steps to reproduce
   
   1.  route config yaml
   ```
   uri: /*
   name: cachalot-console
   methods:
     - GET
     - POST
     - PUT
     - DELETE
     - PATCH
     - HEAD
     - OPTIONS
     - CONNECT
     - TRACE
   host: cachalot-console-admin.stage.yunshanmeicai.com
   plugins:
     client-control:
       disable: true
       max_body_size: 10485760
     response-rewrite:
       body: '{"code":"ok","message":"new json body"}'
       body_base64: false
       disable: false
       headers:
         X-Server-balancer_addr: $balancer_ip:$balancer_port
         X-Server-id: '3'
         X-Server-status: 'on'
       vars:
         - - status
           - '=='
           - '200'
   upstream_id: '6'
   status: 1
   
   ```
   2. curl cachalot-console-admin.stage.yunshanmeicai.com/health  -i 
   
   ### Actual result
   
   ```
   HTTP/1.1 200
   Content-Type: text/plain;charset=UTF-8
   Content-Length: 2
   Connection: keep-alive
   Cache-Control: no-cache, no-store, max-age=0, must-revalidate
   Pragma: no-cache
   Expires: 0
   X-XSS-Protection: 1; mode=block
   X-Frame-Options: DENY
   X-Content-Type-Options: nosniff
   Date: Fri, 29 Oct 2021 09:40:24 GMT
   Server: APISIX
   
   OK%
   ```
   This result return is under apisix-openresty
   
   ### Error log
   
   no error log
   
   ### Expected result
   
   ```
   HTTP/1.1 200
   Content-Type: text/plain;charset=UTF-8
   Transfer-Encoding: chunked
   Connection: keep-alive
   Cache-Control: no-cache, no-store, max-age=0, must-revalidate
   Pragma: no-cache
   Expires: 0
   X-XSS-Protection: 1; mode=block
   X-Frame-Options: DENY
   X-Content-Type-Options: nosniff
   Date: Fri, 29 Oct 2021 09:23:01 GMT
   Server: APISIX
   X-Server-balancer-addr: 10.2.3.138:8089
   X-Server-id: 3
   X-Server-status: on
   
   {"code":"ok","message":"new json body"}%
   ```
   This result return is effective under openresty


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