Here the health check is passed if the status code of the response is in the range 200– 399, and its body does not contain the string maintenance mode. In the following example, if NGINX fails to send a request to a server or does not receive a response from it 3 times in 30 seconds, it marks the server as unavailable for 30 seconds: max_fails – Sets the number of failed attempts that must occur during the fail_timeout period for the server to be marked unavailable (default is 1 attempt).fail_timeout – Sets the time during which a number of failed attempts must happen for the server to be marked unavailable, and also the time for which the server is marked unavailable (default is 10 seconds).The conditions under which an upstream server is marked unavailable are defined for each upstream server with parameters to the server directive in the upstream block: If the transaction still cannot be resumed, NGINX Open Source and NGINX Plus mark the server as unavailable and temporarily stop sending requests to it until it is marked active again.
For active health checks and the live activity monitoring dashboard, NGINX Plus.For passive health checks, NGINX Open Source or NGINX Plus.NGINX and NGINX Plus can continually test your upstream servers, avoid the servers that have failed, and gracefully add the recovered servers into the load‑balanced group. Monitor the health of HTTP servers in an upstream group by sending periodic health checks, including customizable active health checks in NGINX Plus.