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 2022/04/15 17:47:49 UTC
[GitHub] [apisix] MirtoBusico opened a new issue, #6865: help request: Is it possible to apply the same plugins to multiple routes with different upstream?
MirtoBusico opened a new issue, #6865:
URL: https://github.com/apache/apisix/issues/6865
### Description
Hi all,
I need to apply the same plugins to different routes that have different upstreams.
My use case:
Using openid-connect and authz-keycloak on these routers:
https://www.m01.net/frontend (single page application calling api1, api2 and api3) with upstream **frontendapp**
https://www.m01.net/api1 with upstream **api1server**
https://www.m01.net/api2 with upstream **api2server**
https://www.m01.net/api3 with upstream **api3server**
For now everything works if I define the two plugins for every route
I cannot use global plugins because I have some routes that have not to be authenticated/authorized
Is it possible to have the same plugins for different routes with different upstream?
Note: I'm using Apisix 2.13
### Environment
- APISIX version (run `apisix version`): 2.13
- Operating system (run `uname -a`):
- OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
- etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
- APISIX Dashboard version, if relevant:
- Plugin runner version, for issues related to plugin runners:
- LuaRocks version, for installation issues (run `luarocks --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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] MirtoBusico commented on issue #6865: help request: Is it possible to apply the same plugins to multiple routes with different upstream?
Posted by GitBox <gi...@apache.org>.
MirtoBusico commented on issue #6865:
URL: https://github.com/apache/apisix/issues/6865#issuecomment-1100714783
Seems exactly what I need.
I'll try and report here
Thanks
--
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
Re: [I] help request: Is it possible to apply the same plugins to multiple routes with different upstream? [apisix]
Posted by "sampy2518 (via GitHub)" <gi...@apache.org>.
sampy2518 commented on issue #6865:
URL: https://github.com/apache/apisix/issues/6865#issuecomment-1910775425
I have a peculiar situation in my project where I am trying to replace my existing old Proxy code with APISIX. my current proxy backtrack the versions apis and services in a different way. for example.
API Versions available : V1, V2, V3
Routes should be created in below format
V1
API1
Service1
Service2
API2
Service3
Service4
API3
Service5
V2
API2
Service4
API4
Service6
V3
API2
Service4
API5
Service7
API routing, fallback and backtracking rules to follow
case 1:
APP A : current Version used V2. All any API from the frontend will be called with V2
Invoke V2/API1/Service1/ will be redirected to V1/API1/Service1, As it is not present in current version V2, so it will backtrack or fallback to previous version which is V1 and search for the Service1 in API1.
Invoke V2/API1/Service2/ will be redirected to V1/API1/Service2, As it is not present in current version V2, so it will backtrack or fallback to previous version which is V1 and search for the Service2 in API1.
Invoke V2/API2/Service3/ will be redirected to V1/API2/Service3, As it is not present in current version V2, so it will backtrack or fallback to previous version which is V1 and search for the Service3 in API2.
Invoke V2/API2/Service4/ will be redirected to V2/API2/Service4, As it is present in V2
Invoke V2/API3/Service5/ will be redirected to V1/API3/Service5, As it is not present in current version V2, so it will backtrack or fallback to previous version which is V1 and search for the Service5 in API3.
Invoke V2/API4/Service6/ will be redirected to V2/API4/Service6, As it is present in V2
case 2:
APP b : current Version used V3. All any API from the frontend will be called with V3
Invoke V3/API1/Service1/ will be redirected to V1/API1/Service1, As it is not present in current version V3, so it will backtrack or fallback to previous version which is V1 and search for the Service1 in API1.
Invoke V3/API1/Service2/ will be redirected to V1/API1/Service2, As it is not present in current version V3, so it will backtrack or fallback to previous version which is V1 and search for the Service2 in API1.
Invoke V3/API2/Service3/ will be redirected to V1/API2/Service3, As it is not present in current version V3, so it will backtrack or fallback to previous version which is V1 and search for the Service3 in API2.
Invoke V3/API2/Service4/ will be redirected to V3/API2/Service4, As it is present in V3
Invoke V3/API3/Service5/ will be redirected to V1/API3/Service5, As it is not present in current version V3, so it will backtrack or fallback to previous version which is V1 and search for the Service5 in API3.
Invoke V3/API4/Service6/ will be redirected to V2/API4/Service6, As it is not present in current version V3, so it will backtrack or fallback to previous version which is V2 and search for the Service6 in API4.
Invoke V3/API4/Service7/ will be redirected to V3/API5/Service7, As it is present in V3
I would like to ask how can i define a customer global plugin which is work when for any incoming request from client and rewrite the URL as per above rule.
--
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] tzssangglass closed issue #6865: help request: Is it possible to apply the same plugins to multiple routes with different upstream?
Posted by GitBox <gi...@apache.org>.
tzssangglass closed issue #6865: help request: Is it possible to apply the same plugins to multiple routes with different upstream?
URL: https://github.com/apache/apisix/issues/6865
--
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] tzssangglass commented on issue #6865: help request: Is it possible to apply the same plugins to multiple routes with different upstream?
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #6865:
URL: https://github.com/apache/apisix/issues/6865#issuecomment-1100802333
hi @MirtoBusico , pls see: https://github.com/apache/apisix-dashboard/issues/1904
--
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] MirtoBusico commented on issue #6865: help request: Is it possible to apply the same plugins to multiple routes with different upstream?
Posted by GitBox <gi...@apache.org>.
MirtoBusico commented on issue #6865:
URL: https://github.com/apache/apisix/issues/6865#issuecomment-1100841203
Thanks a lot
This solves my question
--
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] tzssangglass commented on issue #6865: help request: Is it possible to apply the same plugins to multiple routes with different upstream?
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #6865:
URL: https://github.com/apache/apisix/issues/6865#issuecomment-1100671228
I think what you need is: https://github.com/apache/apisix/blob/master/docs/en/latest/architecture-design/plugin-config.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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org