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/02/23 07:35:53 UTC

[GitHub] [apisix] frf12 opened a new issue #3642: bug: /apisix/admin 不能被正确的转发

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



[GitHub] [apisix] wujie1993 removed a comment on issue #3642: bug: /apisix/admin 不能被正确的转发

Posted by GitBox <gi...@apache.org>.
wujie1993 removed a comment on issue #3642:
URL: https://github.com/apache/apisix/issues/3642#issuecomment-975022471






-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] tokers commented on issue #3642: bug: /apisix/admin 不能被正确的转发

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


   > > To use APISIX proxy Dashboard, you need to set enable admin to false (because the path of the Admin API and the path of the Manager API are the same, not setting it to false will request to apis of Admin API), and then follow the normal route configuration.
   > 
   > 这能解决使用apisix代理apisix dashboard的问题。但如果我的服务中正好有个api是/apisix/admin呢,那也只能通过设置apisix.enable_admin为false来解决吗?这似乎不合理?
   
   The prefix `/apisix/admin` are occupied by APISIX when the admin api enabled. Try to avoid using it when you design your APIs.
   
   @Firstsawyou I think we can add some documents as hint.


----------------------------------------------------------------
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] wujie1993 commented on issue #3642: bug: /apisix/admin 不能被正确的转发

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


   当前的管理接口和控制接口在职能上似乎是一致的,都是属于apisix的 `控制平面` 接口,是否可以考虑合并为一个`管理`端口呢?对于执行转发代理功能的部分可以独立为一个`路由`端口,这样也可以避免出现接口冲突的情况。


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] spacewander closed issue #3642: bug: /apisix/admin 不能被正确的转发

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


   


----------------------------------------------------------------
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 #3642: bug: /apisix/admin 不能被正确的转发

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


   It's better to use a separate port for apisix admin:
   https://github.com/apache/apisix/blob/728df41e1682da8d4cd615a613a938e275a4d085/conf/config-default.yaml#L68
   
   We want to make it the default months ago:
   https://lists.apache.org/thread.html/rfb780891c940f4930240570d0170fad154a14d7b582ca60b4eae7524%40%3Cdev.apisix.apache.org%3E
   
   But people can't accept such a break change in a minor version.


----------------------------------------------------------------
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] wujie1993 commented on issue #3642: bug: /apisix/admin 不能被正确的转发

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


   在行使`路由`职能的端口上预设管理接口,这样的设计是会影响`网关`在使用时的自由度的。


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] wujie1993 edited a comment on issue #3642: bug: /apisix/admin 不能被正确的转发

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


   在行使`路由`职能的端口上预设管理接口,这样的设计似乎会影响使用上的自由度。


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] tokers edited a comment on issue #3642: bug: /apisix/admin 不能被正确的转发

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


   > > To use APISIX proxy Dashboard, you need to set enable admin to false (because the path of the Admin API and the path of the Manager API are the same, not setting it to false will request to apis of Admin API), and then follow the normal route configuration.
   > 
   > 这能解决使用apisix代理apisix dashboard的问题。但如果我的服务中正好有个api是/apisix/admin呢,那也只能通过设置apisix.enable_admin为false来解决吗?这似乎不合理?
   
   The prefix `/apisix/admin` are occupied by APISIX when the admin api enabled. Try to avoid using it when you design your APIs.
   
   @Firstsawyou I think we can add some documents to remind users.


----------------------------------------------------------------
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] Firstsawyou commented on issue #3642: bug: /apisix/admin 不能被正确的转发

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


   > he prefix `/apisix/admin` are occupied by APISIX when the admin api enabled. Try to avoid using it when you design your APIs.
   > 
   > @Firstsawyou I think we can add some documents to remind users.
   
   agree.


----------------------------------------------------------------
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] frf12 commented on issue #3642: bug: /apisix/admin 不能被正确的转发

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


   > To use APISIX proxy Dashboard, you need to set enable admin to false (because the path of the Admin API and the path of the Manager API are the same, not setting it to false will request to apis of Admin API), and then follow the normal route configuration.
   
   这能解决使用apisix代理apisix dashboard的问题。但如果我的服务中正好有个api是/apisix/admin呢,那也只能通过设置apisix.enable_admin为false来解决吗?这似乎不合理?


----------------------------------------------------------------
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] wujie1993 edited a comment on issue #3642: bug: /apisix/admin 不能被正确的转发

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


   在行使`路由`职能的端口上预设管理接口,这样的设计是似乎会影响使用时的自由度。


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] Firstsawyou commented on issue #3642: bug: /apisix/admin 不能被正确的转发

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


   To use APISIX proxy Dashboard, you need to set enable admin to false (because the path of the Admin API and the path of the Manager API are the same, not setting it to false will request to apis of Admin API), and then follow the normal route configuration.


----------------------------------------------------------------
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] Firstsawyou commented on issue #3642: bug: /apisix/admin 不能被正确的转发

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


   > 这能解决使用apisix代理apisix dashboard的问题。但如果我的服务中正好有个api是/apisix/admin呢,那也只能通过设置apisix.enable_admin为false来解决吗?这似乎不合理?
   
   When apisix.enable_admin is true, `/apisix/admin` is the unique API interface of apisix, and the custom api cannot be the same.


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