Restarting upstream servers

Aníbal Rojas anibalrojas at
Thu May 22 15:29:32 MSD 2008

I understand you want to prevent the first set of failed request
against the restarting upstreams.

Ugly but it should work:

Modify Nginx configuration, remove the upstream for the first server, signal it.
Restart upstream servers in the first server.
Modify Nginx configuration, add the restarted upstreams and remove the
the ones from the second, signal it.
Restart upstream servers in the second server.

Nginx reloads configuration very quickly.

All this can be easily automated.

Aníbal Rojas

On Thu, May 22, 2008 at 9:28 PM, Joe Van Dyk <joe at> wrote:
> Hi,
> I'm using a bunch of upstream servers and using nginx as a proxy for
> them.  The upstreams run on two different machines.
> When I restart the upstreams on one server, I get a bunch of errors like these:
> 2008/05/21 18:02:39 [error] 4658#0: *36236 sendfilev() failed (134:
> Transport endpoint is not connected) while sending request to
> upstream, client:, server:, URL:
> "/feed/products?t=1211418157562", upstream:
> "", host:
> ""
> 2008/05/21 18:02:40 [error] 4645#0: *66641 connect() failed (146:
> Connection refused) while connecting to upstream, client:
>, server:, URL:
> "/uploaded_files/0025/1630/Springboard_midget_size.jpg?1208317017",
> upstream: "",
> host: "", referrer:
> ""
> Any way to avoid those?  Ideally, since not all the upstreams are
> down, when the request to the upstream fails due to connection
> problems, I'd like to try the request on a different upstream, so the
> user doesn't see anything wrong.
> Joe

More information about the nginx mailing list