The 502 Bad Gateway error indicates that the reverse proxy received an invalid response from the upstream server. This typically happens when NGINX or Apache cannot communicate with PHP‑FPM, the database, or another service. The proxy returns a 502 status to the browser.
Common triggers include upstream timeout, worker exhaustion, firewall block, DNS failure, or network loss. When the upstream service stops responding, the proxy cannot forward the request and shows the error page.