-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
Issue description
/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
oropenresty -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 '
{
"name": "test",
"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
Metadata
Metadata
Assignees
Labels
No labels