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/01 11:56:15 UTC

[GitHub] [apisix] tokers commented on issue #3959: proposal: Should apisix support host+path as route?

tokers commented on issue #3959:
URL: https://github.com/apache/apisix/issues/3959#issuecomment-811856236


   > > This is already supported, you can refer to the description of `radixtree_host_uri` here: https://github.com/apache/apisix/blob/master/docs/en/latest/architecture-design/router.md
   > 
   > I have see the
   > 'radixtree_host_uri:https://github.com/apache/apisix/blob/master/apisix/http/router/radixtree_host_uri.lua#L79' , I think this can not support the 'host+path' case, because the hosts and paths in route is two properties, for example :
   > 
   > ```
   > hosts: a.com b.com
   > path: /a /b
   > ```
   > 
   > their should be four combinations
   > 
   > ```
   > a.com /a
   > a.com /b
   > b.com /a
   > b.com /b
   > ```
   > 
   > all this situation can hit the route, but I want the route config is
   > 
   > ```
   > a.com /a 
   > b.com /b 
   > ```
   > 
   > this just two situation can hit the route, to implementation this situation we should change the route config such as
   > 
   > ```
   > host_paths:[{
   > host: a.com,path: /a}
   > {host:b.com,path:/b} ]
   > ```
   > 
   > this is not a compatible change.
   
   What you want can be achieved by splitting this into two routes. The first route contains host `a.com` and uri `/a`, and
   similarly, the second route has host `b.com` and uri `/b`.


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