I understand the use of fail_timeout and max_fails parameters in nginx configuration according to the docs.
fail_timeout
max_fails
In my testing with nginx stream prox