EMZETT.
Login

HTTP 502 Bad Gateway

In short: A gateway or proxy received an invalid response from the server behind it.

In more detail: Typical with nginx, Cloudflare or load balancers.

In Depth

Possible causes

  • Backend process crashed or restarted.
  • Wrong upstream port.
  • Timeout at the backend.

Solutions

  1. Check and restart the backend service.
  2. Check proxy configuration and ports.
  3. Compare logs of proxy and application.

See also: HTTP 500 Internal Server Error, HTTP 504 Gateway Timeout, Load Balancing