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/11/07 21:31:47 UTC

[GitHub] [apisix] DenisMedeiros opened a new issue, #8271: help request: different paths for each upstream node

DenisMedeiros opened a new issue, #8271:
URL: https://github.com/apache/apisix/issues/8271

   ### Description
   
   Hello APISIX team,
   
   I am trying to set up a route that sends the request to an upstream with 2 nodes but each one should have a different path. For example:
   
   Route:
   
   - Host:  `example.com`
   - URI: `/v1/example`
   - Method: `GET`
   
   Upstream (round-robin):
   
   - Node1: `internal-node.com:443/namespace/123/v1/action1`
   - Node2: `internal-node.com:443/namespace/456/v1/action2`
   
   As you guys can see, the upstream nodes have a different paths than the original one defined in the route.
   
   If I was using an upstream with a single node, then I could use the plugin `proxy-rewrite` to modify the URI and adjust the path to the expected format but since there are multiple nodes in the upstream, the new path cannot be fixed. 
   
   Do you guys have any suggestion on how to cover this case? Maybe using a custom function using `serverless-post-function`?
   
   Thanks in advance!
   
   ### Environment
   
   - APISIX version (run `apisix version`): `3.0.0`
   - Operating system (run `uname -a`):  `Linux 4.15.0-193-generic #204-Ubuntu SMP Fri Aug 26 19:20:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux`
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): `nginx version: openresty/1.21.4.1`
   - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`): `3.5.0`
   - APISIX Dashboard version, if relevant: `N/A`
   - Plugin runner version, for issues related to plugin runners: `N/A`
   - LuaRocks version, for installation issues (run `luarocks --version`): `N/A`
   


-- 
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] tokers commented on issue #8271: help request: different paths for each upstream node

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

   It's tough to do this, unless you write your own balancer.
   
   By the way, could you explain the reason that you want to do this?


-- 
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] DenisMedeiros commented on issue #8271: help request: different paths for each upstream node

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

   Sure, we will try this path then. 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


[GitHub] [apisix] DenisMedeiros commented on issue #8271: help request: different paths for each upstream node

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

   > It's tough to do this, unless you write your own balancer.
   > 
   > By the way, could you explain the reason that you want to do this?
   
   The reason is that we are trying to forward the request to cloud functions, deployed in 2 different datacenters. It's the exaxt same function in the 2 locations but the cloud function platform generates a different/ unique URI - that's why we were trying to find a way to implement this.
   
   For example:
   
   https://us-east1.functions.example.com/api/v1/namespaces/<unique-id>/actions/v1/action"
   https://us-east2.functions.example.com/api/v1/namespaces/<unique-id>/actions/v1/action"
   https://us-east3.functions.example.com/api/v1/namespaces/<unique-id>/actions/v1/action"
   
   As you can see, the only problem is this `unique id` that the cloud function platform generates and we cannot enforce to be the same across the datacenters.
   
   I was wondering if there would be a way to modify a request (using one of those plugins) to replace that `unique id` depending on the selected node by the upstram load balancer. Would this be possible? If not, we will implement an external load balancer then.
   
   Thanks for your help.
   
   
     


-- 
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] DenisMedeiros closed issue #8271: help request: different paths for each upstream node

Posted by GitBox <gi...@apache.org>.
DenisMedeiros closed issue #8271: help request: different paths for each upstream node
URL: https://github.com/apache/apisix/issues/8271


-- 
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 #8271: help request: different paths for each upstream node

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

   > > It's tough to do this, unless you write your own balancer.
   > > By the way, could you explain the reason that you want to do this?
   > 
   > The reason is that we are trying to forward the request to cloud functions, deployed in 2 different datacenters. It's the exaxt same function in the 2 locations but the cloud function platform generates a different/ unique URI - that's why we were trying to find a way to implement this.
   > 
   > For example:
   > 
   > * `https://us-east1.functions.example.com/api/v1/namespaces/<unique-id>/actions/v1/action"`
   > * `https://us-east2.functions.example.com/api/v1/namespaces/<unique-id>/actions/v1/action"`
   > * `https://us-east3.functions.example.com/api/v1/namespaces/<unique-id>/actions/v1/action"`
   > 
   > As you can see, the only problem is this `unique id` that the cloud function platform generates and we cannot enforce to be the same across the datacenters.
   > 
   > I was wondering if there would be a way to modify a request (using one of those plugins) to replace that `unique id` depending on the selected node by the upstram load balancer. Would this be possible? If not, we will implement an external load balancer then.
   > 
   > Thanks.
   
   Apache APISIX supports several FaaS services, try to check them out and see if yours is there (https://apisix.apache.org).


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