frf12 opened a new issue #3642:
URL: https://github.com/apache/apisix/issues/3642


   ### Issue description
   使用apisix代理apisix 
dashboard时发现所有的/apisix/admin的路径会因为匹配/apisix/admin而被转发给apisix admin模块
   ### Environment
   
   * apisix version (cmd: `apisix version`): 2.3
   * OS (cmd: `uname -a`): centos7
   * OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):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.0
   * apisix-dashboard version, if have:2.3
   
   ### Minimal test code / Steps to reproduce the issue
   
   1.创建一个路由,将foo.com域名的请求都转发到127.0.0.1:8888
   curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
   {
       "uri": "/*",
       "hosts": ["foo.com"],
       "methods": ["PUT", "GET"],
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "127.0.0.1:8888": 1
           }
       }
   }'
   2.尝试请求http://foo.com/apisix/admin/user/login 
   curl 'http://foo.com/apisix/admin/user/login' \
     --data-raw '{"username":"admin","password":"admin"}' \
     --compressed \
     --insecure -v
   
   
   ### What's the actual result? (including assertion message & call stack if 
applicable)
   返回401。观察logs/error.log发现,请求被认为是apisix admin的请求,被转发到了apisix 
admin模块。因为请求没有带key,所有返回401
   ### What's the expected result?
   请求应该转发到127.0.0.1:8888


----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to