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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to