I have a requirement to dynamically forward request to a NGINX conf file based upon a user session variable.
Currently, I see this as a series of NGXIN conf files:
1) nginx public Conf -> 2) nginx internal Conf A
|
-> 3) nginx internal Conf B
1) public Conf : public server_name (acts like a router), receives the HTTP request based upon host header
2) host only internal Conf A : called by public Conf, will proxy_pass to remote server, contains app specific NGINX directives
3) host only internal Conf B : called by public Conf, will proxy_pass to remote server, contains app specific NGINX directives
I have this working by using proxy_pass (to unix socket) -> internal Conf (unix socket listener) or I can likely build this using lua-resty-http. But, I can't help wondering if there is a more efficient / internal Server Router capability native to NGINX.
What I need is a smart internal load balancer, as I'd rather the TCP request go directly to the internal Conf files so things like client_max_body_size are not negated by the public Conf.
TIA,
Martin