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 03:04:45 UTC
[GitHub] [apisix] gy09535 opened a new issue #3959: proposal:should apisix support host+path as root?
gy09535 opened a new issue #3959:
URL: https://github.com/apache/apisix/issues/3959
### Issue description
Now apisix support hosts and paths as route, such as this config:
```
a.com
b.com
/a
/b
```
But sometimes we have some business scenario should support host+path as route, such as:
```
a.com /a
b.com /b
```
I have see the apisix route match radix-tree code, If we implementation this, we should split the route, I think this change is very big. I have a proposal, should we write a plugin to support it, and in the plugin we create a sub radix-tree which spilt the route as the sub routes. we can use the plugin to do the verification.
### Environment
* apisix version (cmd: `apisix version`):
* OS (cmd: `uname -a`):
* OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
* etcd version, if have (cmd: run `curl http://127.0.0.1:9090/v1/server_info` to get the info from server-info API):
* apisix-dashboard version, if have:
--
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] tokers commented on issue #3959: proposal: Should apisix support host+path as route?
Posted by GitBox <gi...@apache.org>.
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
[GitHub] [apisix] gy09535 commented on issue #3959: proposal: Should apisix support host+path as route?
Posted by GitBox <gi...@apache.org>.
gy09535 commented on issue #3959:
URL: https://github.com/apache/apisix/issues/3959#issuecomment-811930347
> > > 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`.
Yes, it can work, but if you have too many paths, you should create more routes.
--
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] gy09535 commented on issue #3959: proposal: Should apisix support host+path as route?
Posted by GitBox <gi...@apache.org>.
gy09535 commented on issue #3959:
URL: https://github.com/apache/apisix/issues/3959#issuecomment-811821940
> 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.
--
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 #3959: proposal: Should apisix support host+path as route?
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on issue #3959:
URL: https://github.com/apache/apisix/issues/3959#issuecomment-811621450
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
--
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] gy09535 closed issue #3959: proposal: Should apisix support host+path as route?
Posted by GitBox <gi...@apache.org>.
gy09535 closed issue #3959:
URL: https://github.com/apache/apisix/issues/3959
--
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