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:34:06 UTC

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

cverdela opened a new issue #4104:
URL: https://github.com/apache/apisix/issues/4104


   ### 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 any route
   
   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



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

Posted by GitBox <gi...@apache.org>.
cverdela commented on issue #4104:
URL: https://github.com/apache/apisix/issues/4104#issuecomment-824510915


   @spacewander 


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



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

Posted by GitBox <gi...@apache.org>.
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



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

Posted by GitBox <gi...@apache.org>.
cverdela edited a comment on issue #4104:
URL: https://github.com/apache/apisix/issues/4104#issuecomment-824513110


   When both Route and Service enable the same plugin, the Route parameter has a higher priority than Service.
   
   However,I want to add  proxy-rewrite plugin to both route and service


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



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

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #4104:
URL: https://github.com/apache/apisix/issues/4104#issuecomment-824519895


   APISIX doesn't support running the same plugin twice. This breaks many assumptions and requires rewriting much of the code.


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



[GitHub] [apisix] spacewander commented on issue #4104: bug: proxy-rewrite plugin in service does not take effect

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #4104:
URL: https://github.com/apache/apisix/issues/4104#issuecomment-824487577


   Can't reproduce at my side. I got:
   ```
   2021/04/22 10:08:09 [error] 2454#2454: *2 [lua] [string "return function() local headers_tab = ngx.req..."]:1: func(): --header--1:2--header-- while logging request, client: 127.0.0.1, server: localhost, request: "GET /hello HTTP/1.1", upstream: "http://127.0.0.1:1980/hello", host: "localhost"
   2021/04/22 10:08:09 [error] 2454#2454: *2 [lua] [string "return function() local headers_tab = ngx.req..."]:1: func(): --header--host:localhost--header-- while logging request, client: 127.0.0.1, server: localhost, request: "GET /hello HTTP/1.1", upstream: "http://127.0.0.1:1980/hello", host: "localhost"
   2021/04/22 10:08:09 [error] 2454#2454: *2 [lua] [string "return function() local headers_tab = ngx.req..."]:1: func(): --header--connection:close--header-- while logging request, client: 127.0.0.1, server: localhost, request: "GET /hello HTTP/1.1", upstream: "http://127.0.0.1:1980/hello", host: "localhost"
   ```
   
   Here is my route configuration:
   ```
   {
       "uri": "/hello",
       "service_id": 1
   }
   ```


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



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

Posted by GitBox <gi...@apache.org>.
spacewander closed issue #4104:
URL: https://github.com/apache/apisix/issues/4104


   


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



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

Posted by GitBox <gi...@apache.org>.
cverdela commented on issue #4104:
URL: https://github.com/apache/apisix/issues/4104#issuecomment-824513110


   When both Route and Service enable the same plugin, the Route parameter has a higher priority than Service.
   
   However,I want to add plug-ins to both route and service


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



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

Posted by GitBox <gi...@apache.org>.
cverdela closed issue #4104:
URL: https://github.com/apache/apisix/issues/4104


   


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



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

Posted by GitBox <gi...@apache.org>.
cverdela commented on issue #4104:
URL: https://github.com/apache/apisix/issues/4104#issuecomment-824510675


   update


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