I am using upstream balancer with resty-chash module which works great. Performance is amazing.
One of the requirements we have is to override the first level of the ontology in the request uri based on the backend server. For an api, we have two implementations and both have different service context root.
e.g 1. /
abc.web/service/def 2. /
abc-context/service/def
Is it possible to override the upstream request uri in the balancer.set_current_peer ? I am thinking to modify following code. Please let me if I am on right track.
ngx_memcpy(url.url.data, addr, addr_len);
url.url.len = addr_len;
url.default_port = (in_port_t) port;
url.uri_part = 0;
url.no_resolve = 1;
with
code from ngx_http_proxy_module.c: ngx_http_proxy_eval() where it is populating the url and setting ngx_http_proxy_set_vars(&url, &ctx->vars);
Thanks,
Joshi