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 2021/04/22 03:27:13 UTC

[GitHub] [apisix] cverdela commented on issue #4104: bug: if route has a proxy-rewrite plugin , proxy-rewrite plugin in service does not take effect

cverdela commented on issue #4104:
URL: https://github.com/apache/apisix/issues/4104#issuecomment-824510557


   Issue description
   Environment
   apisix version (cmd: apisix version):2.3 (docker image apache/apisix:2.3-alpine )
   OS (cmd: uname -a):Linux 570c5064c3f9 4.9.93-linuxkit-aufs #1 SMP Wed Jun 6 16:55:56 UTC 2018 x86_64 Linux ( docker )
   OpenResty / Nginx version (cmd: nginx -V or openresty -V): openresty/1.19.3.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.9
   apisix-dashboard version, if have:2.4
   luarocks version, if the issue is about installation (cmd: luarocks --version):luarocks 3.3.1
   Minimal test code / Steps to reproduce the issue
   
   any upstream  
   
   route conifg :
   
   {
       "status": 1,
       "name": "web2",
       "uris": [
           "/we/*"
       ],
       "methods": [
           "GET",
           "HEAD",
           "POST",
           "PUT",
           "DELETE",
           "OPTIONS",
           "PATCH"
       ],
       "id": "351385589259436746",
       "create_time": 1618971732,
       "plugins": {
           "proxy-rewrite": {
             "scheme": "http",
             "regex_uri": ["^/we/web(.*)", "/web$1"]
           }
       },
       "update_time": 1618971986,
       "labels": {
           "API_VERSION": "1"
       },
       "service_id": "348075546078347976"
   }
   
   service config :
   {
   "update_time": 1618987372,
   "id": "348075546078347976",
   "upstream_id": "351385449672999625",
   "plugins": {
   "proxy-rewrite": {
   "headers": {
   "1": "2"
   }
   },
   "serverless-pre-function": {
   "phase": "log",
   "functions" : ["return function() local headers_tab = ngx.req.get_headers() for k,v in pairs(headers_tab) do ngx.log(ngx.ERR,'--header--'..k..':'..v..'--header--') end end"]
   }
   },
   "desc": "测试",
   "name": "test",
   "create_time": 1616998792
   }
   
   What's the actual result? (including assertion message & call stack if applicable)
   headers without "1":"2"
   
   What's the expected result?
   headers with "1":"2"


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

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