2

Im trying to do the following where:

nginx should accept incoming requests from clients and rewrite/proxy them to dynamic upstreams as instructed by a "dynamic routing endpoint" The dynamic routing endpoint is an external HTTP API endpoint that returns the IP:port of the upstream for each request. When nginx receives a request it should send an HTTP subrequest, containing only the HTTP method, target hostname and URL of the original request, to the dynamic routing HTTP endpoint The dynamic routing HTTP endpoint responds to each request with a list of IP:port tuples Nginx should pick a random IP:port tuple from the ones returned in the subrequest as the upstream and proxy_pass the original request to it.

Any help/hint would be highly appreciated.Thanks.

Dilip
  • 139
  • 2
  • This could be over the limit what nginx can do... You can take a look into nginx `lua` module and see if you can write a program there that does what you are looking for. If you cannot create it with lua, then you need to write the program using PHP or other scripting language. – Tero Kilkanen May 14 '17 at 06:51

0 Answers0