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
- Check and restart the backend service.
- Check proxy configuration and ports.
- Compare logs of proxy and application.
See also: HTTP 500 Internal Server Error, HTTP 504 Gateway Timeout, Load Balancing