I'm developing a new web platform for my business on AWS, the current configuration uses nginx+ as load balancer and some apache instances as backend.
With the service of autoscaling I'm able to exploit the features of dynamic configuration of nginx+, so every time a new web server is activated the configuration of nginx is automatically update and the new backend is hooked to the balancer.
The problem is this: if by chance nginx crashes or is restarted the balancer lost its dynamic configuration and the balancer does not route more the connections to a running web server. I thought to sort it out with a cron on backend that did a check on the state of the balancer, but this is not a solution very clean and functional.
I'm looking for the solution as automatic as possible, which can guarantee the balancing mechanism with the least possible work for the operator. Any idea?