I would like to deploy a reverse proxy/HTTP load balancer in front of a number of backend application servers. The hitch is that the set of backends may change over time, and new application servers may be created dynamically (so the total set cannot be known in advance). This means something like Varnish, which can perform health checks against a known set of backends, isn't an option.
The best I've been able to come up with is the
RewriteMap support in Apache combined with proxy
RewriteRule expressions. I've hacked together a simple client/server mechanism for the application servers to "register" themselves with the frontend, and a
RewriteMap program that selects backends from this list. It works, but it smells really hacky.
This seems like it must be a reasonably common scenario (with so many cloud service providers out there that make it easy to spin up new servers on demand). How are other people solving this problem? Are you just using a commercial load balancer? Are is everyone throwing together something on their own?