Skip to content
fixerror.dev
502 5xx RFC 9110 §15.6.3

Bad Gateway

Server (acting as proxy/gateway) received an invalid response from upstream.

What HTTP 502 means

RFC 9110 §15.6.3. The reverse proxy (nginx, Cloudflare, ALB) couldn't get a valid response from your application. Causes: app crashed, app not listening on expected port, malformed response from upstream, upstream connection reset.

Typical causes

  • Upstream app crashed
  • App not listening
  • Connection reset by upstream
  • Malformed upstream response
  • Wrong upstream port