You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "bo-unitysvc (via GitHub)" <gi...@apache.org> on 2025/11/09 06:44:18 UTC
[I] help request: Dynamic Upstream Routing [apisix]
bo-unitysvc opened a new issue, #12739:
URL: https://github.com/apache/apisix/issues/12739
### Description
We are developing a custom APISIX plugin that performs fully dynamic upstream routing based on user subscriptions. The upstream URL (including scheme, host, and port) is determined at request time by querying our backend API, which returns different upstream targets depending on the user and subscription.
We’ve successfully implemented the logic to retrieve the correct upstream URL, but APISIX does not actually forward the request to the resolved target.
We have tried the following approaches (but might not have implemented them correctly):
1. Using `upstream.set(ctx, upstream_key, ctx.conf_version, upstream_conf)`
2. Using `balancer.set_current_peer(host, port, {ssl = is_ssl})`
3. Settomg `ctx.balancer_ip` and `ctx.balancer_port` during access phase
However, none of these methods caused APISIX to forward the request correctly.
Question:
In APISIX 3.x, what is the correct way for a custom plugin to dynamically set the upstream URL (scheme, host, and port) for each request?
### Environment
- APISIX Version: 3.x (latest)
- Deployment: Docker
- Plugin Language: Lua
--
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
Re: [I] help request: Dynamic Upstream Routing [apisix]
Posted by "bo-unitysvc (via GitHub)" <gi...@apache.org>.
bo-unitysvc commented on issue #12739:
URL: https://github.com/apache/apisix/issues/12739#issuecomment-3508408178
It looks like the correct approach is to use `upstream.set()` in the access phase with **resolved IP addresses** in the nodes array, while preserving the domain for SNI and Host headers.
--
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: Dynamic Upstream Routing [apisix]
Posted by "bo-unitysvc (via GitHub)" <gi...@apache.org>.
bo-unitysvc closed issue #12739: help request: Dynamic Upstream Routing
URL: https://github.com/apache/apisix/issues/12739
--
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