No live upstreams

Jean-Paul Hemelaar hemelaar at
Thu May 10 12:54:28 UTC 2018


I'm using Nginx as a proxy to Apache.

I noticed some messages in my error.log that I cannot explain:
27463#0: *125209 no live upstreams while connecting to upstream, client:
x.x.x.x, server:, request: "GET /xxx/ HTTP/1.1", upstream: "
http://backend/xxx/", host: ""

The errors appear after Apache returned some 502-errors; however in the
configuration I have set the following:

upstream backend {
        server max_fails=3 fail_timeout=10;
        server backup;
        keepalive       6;

server {
    location / {
     proxy_pass  http://backend;
     proxy_next_upstream error timeout invalid_header;


I expected that, if Apache returns a few 502's:
- Nginx will not try to proceed to the next upstream as proxy_next_upstream
doesn't mention the http_502 but just forward the 502 to the client
- if the upstream is marked as failed (what I didn't expect to happen) the
server will try the backup server instead

What can be happening:
- If the primary server sends a 502 it tries the backup that will send a
502 as well. Because the max_fails is not defined it will be marked as
failed after the first failure.

Not sure if the above assumption is true. If it is, why are they marked as
failed even when the http_502 is not mentioned?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list