Nginx upstream loadbalancing: auto retrying of 502's?

nginx, reverse-proxy

Solution

from the documentation

If with an attempt at the work with the server error occurred, then the request will be transmitted to the following server and then until all workers of server not are tested. If successful answer is not succeeded in obtaining from all servers, then to client will be returned the result of work with the last server.

Problem

If I have nginx loadbalancing for multiple upstream reverse proxies, and one of them goes down, will my user get a 502, or will nginx take care of re-routing to an upstream that is up?

Original source