Is it possible to configure nginx to query a service (not DNS) to determine the proxy_pass destination based on the currently-requested URI?
For example:
- Client requests http://somesite.tld/somepage, which needs to be proxied.
- nginx connects to the resolving service and sends the request URI which is used to determine the proxy destination.
- The resolving service responds, providing the hostname of the destination.
- The client's request is redirected to the given destination.
If this is not supported, what would be a good way to do this? I could proxy_pass to a resolver+proxy, but would prefer to let nginx handle the proxying directly to the destination. Note that the resolver needs to be queried because the destinations for each URI may change.
Thanks :-)