no live upstreams while connecting to upstream Nginx / Apache Origin: Edge & web server OSI layer 7 · Application Last updated 5 Nov 2026

Nginx: [error] no live upstreams while connecting to upstream (503/502)

All servers in an upstream group are marked unavailable, so Nginx has nothing to proxy to.

Exact message you may see no live upstreams while connecting to upstream[error] no live upstreams while connecting to upstream502 Bad Gateway no live upstreamsnginx no live upstreams while connecting to upstream client
Seen on: Nginx Linux

Meaning

After repeated failures (max_fails/fail_timeout), Nginx temporarily marks servers down. Fix the backends, tune max_fails=3 fail_timeout=10s, or add health checks. If you have a single server in the upstream, one failure can mark it down — consider max_fails=0 or using proxy_pass directly.

Common causes

  • All upstream servers failed health/connection checks
  • max_fails too low with intermittent errors
  • Backend overloaded/crashed
  • Wrong upstream addresses
  • Single-server upstream marked down

⚡ Quick fix

  1. Fix/restart backends and read the preceding connect() errors
  2. Tune max_fails/fail_timeout or set max_fails=0 for single server
  3. Add more servers and health checks

Detailed fix by platform

Nginx

  1. upstream app { server 127.0.0.1:3000 max_fails=3 fail_timeout=10s; keepalive 16; }

How to diagnose

  1. Servers — Reachable?
  2. max_fails — Reached?
  3. Count — Single backend?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Edge & web server. Errors that are often confused with or caused by this one (click to open):

502 — HTTP 502 Bad Gateway (HTTP)502connect() failed (111: Connection refused) while connecting to upstream — Nginx: [error] connect() failed (111: Connection refused) while connecting to upstream, upstream: "http://127.0.0.1:3000/" (Nginx / Apache)connect() failed (111…ModSecurity: Access denied with code 403 — Nginx/Apache: ModSecurity: Access denied with code 403 (phase 2). Matched "Operator GE matched 5 at TX:anomaly_score" (Nginx / Apache)ModSecurity: Access d…nginx: client intended to send too large body — Nginx: [error] client intended to send too large body: 5242880 bytes (413 Request Entity Too Large) (Nginx / Apache)nginx: client intende…nginx: host not found in upstream — Nginx: nginx: [emerg] host not found in upstream "app" in /etc/nginx/conf.d/default.conf:5 (Nginx / Apache)nginx: host not found…recv() failed (104: Connection reset by peer) while reading response header — Nginx: [error] recv() failed (104: Connection reset by peer) while reading response header from upstream (Nginx / Apache)recv() failed (104: C…upstream prematurely closed connection while reading response header — Nginx: [error] upstream prematurely closed connection while reading response header from upstream (Nginx / Apache)upstream prematurely …no live u…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.