Hello,
We are developing a balancer that determine an upstream based on parameters of incoming request and redirect the request to this upstream.
The list of upstreams, their servers and parameters of each server (host, port, max_fails, connect_timeout, uri, weight) are stored in lua configuration file.
The upstream is determined in directive rewrite_by_lua* where the request is parsed.
Directive balancer_by_lua* is used for the balancer. Here we determine the server to redirect the request to.
Our problem is that we cannot change the uri in balancer_by_lua* because ngx.req.set_uri is not available in this context.
Is there any chance to make ngx.req.set_uri available in balancer_by_lua*?