When using Azure Front Door for load balancing between two VMs, it should automatically route traffic to the second VM if the first one fails
but you need to be careful for the following condiguration
- Azure Front Door configuration > Origin Group > Health Probes.
- Check: Protocol: Does the protocol (HTTP or HTTPS) align with your Nginx setup on the VMs? Interval: Is the interval frequent enough to detect failures quickly?
then
- Azure Front Door configuration > Backend Pools
- Check that the VMs and their health probe status is "Healthy."
- Ensure Priority and Weight settings are configured correctly