Explore Bato Web Agency Webflow Certified Partner Profile Explore Bato Web Agency Webflow Certified Partner Profile

How do you fix a 502 Bad Gateway error on a WordPress site?

Illustration without a description Illustration without a description

A 502 response usually comes from a proxy, CDN, load balancer, or web server that received an invalid response from the next service in the request path. PHP-FPM may have stopped, the origin server may be unreachable, or a process may have crashed before returning valid headers.

 

Check whether the hosting provider or CDN reports an incident and test the origin separately when you have a safe method. Review proxy, web-server, and PHP logs for the same timestamp. A 502 on every page points toward infrastructure, while one failing URL may involve a heavy plugin action, malformed response, or application crash.

 

Restarting PHP or the web service may restore access, but server restarts belong to the host or administrator responsible for that environment. On managed hosting, contact support with the exact error and time. Also inspect recent PHP version changes, deployments, cache rules, and firewall settings that could interrupt communication between layers.

 

When WordPress is causing the upstream process to fail, use the PHP log to isolate the plugin, theme, or custom request. Reduce expensive work, correct timeouts and worker limits with evidence, and test the repair under realistic traffic. Purge proxy caches only after the origin returns a stable response.