nginx has a feature called proxy_next_upstream where it will retry a request against another upstream if an error occurs on the 1st upstream it tries, such as an error, timeout, or certain http code:
https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_next_upstream
Does similar functionality exist in an ALB where it retries a request against another target if the 1st target fails?
In my example, I have 2 EC2 webservers behind an ALB, and if I reboot one of them or it has another issue, could the ALB immediately start redirecting traffic to the other EC2? I have the Health Check at 5 seconds, but hoping to avoid the downtime waiting for the Health Checks to fail.
Or is there another way to avoid downtime in a scenario like this?
Thank you for your help.
Thanks, I will check into removing the EC2 from the target group for reboots. Are there any options for unplanned outages such as if the webserver stops responding? I see the minimum HealthCheckIntervalSeconds is 5 and UnhealthyThresholdCount is 2, so I believe that means there will be at most 10 seconds of downtime where end users will get http 502 errors trying to access my website. Is there any way to have a faster failover since I already have a 2nd (or 3rd or more) webserver in the load balancer?
I suppose I could write my own script to check the webserver health on a faster interval and remove it from the target group myself, but curious if there was a better way.
Thanks again for your help.