chyoong opened a new issue, #8087:
URL: https://github.com/apache/apisix/issues/8087

   ### Current Behavior
   
   Hi, I would also like to use nginx sub_filter in apisix, but it still 
doesn't work when I use it in apache/apisix:2.99.0-debian,and I see an 
identical issue and have been merged,there 
https://github.com/apache/apisix/issues/5451
   
   ### Expected Behavior
   
   Before content:
   ```html
   <head>
       <title>test</title>
       <meta charset="utf-8">
   </head>
   ```
   
   ideally, use the content after `filter`:
   ```html
   <head>
       <title>test</title>
       <meta charset="utf-8">
       <script>console.log(1)</script>
   </head>
   ```
   
   However, it does not take effect
   
   ### Error Logs
   
   _No response_
   
   ### Steps to Reproduce
   
   1. Use docker-compose deployment
   2. In the `plugin/market` path, enable the `response-rewrite` plugin
   3. configuration parameters are as follows
   ```json
   {
     "disable": false,
     "filters": [
       {
         "regex": "</head>",
         "replace": "<script>console.log(1)</script></head>",
         "scope": "global"
       }
     ],
     "headers": {
       "set": {
         "x-powered-by": "",
         "x-server-balancer_addr": "$balancer_ip:$balancer_port"
       }
     },
     "vars": [
       [
         "status",
         "==",
         200
       ],
       [
         "content-type",
         "==",
         "text/html; charset=utf-8"
       ]
     ]
   }
   ```
   
   ### Environment
   
   - APISIX version (run `apisix version`): 2.99.0
   - Operating system (run `uname -a`): Linux test 3.10.0-1160.62.1.el7.x86_64 
#1 SMP Tue Apr 5 16:57:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`): bitnami/etcd:3.4.15
   - APISIX Dashboard version, if relevant: apache/apisix-dashboard:2.13-alpine
   


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