Skip to main content
Web & HTTP Errors

How to Fix 502 Bad Gateway Error

Zone Desire troubleshooting feature image
502 Bad Gateway

Quick answer

A 502 Bad Gateway error means a gateway or proxy server got an invalid response from the main server. Reload the page, clear cache and try later; site owners should check that the origin server, PHP-FPM and CDN settings are working.

What does “502 Bad Gateway” mean?

HTTP 502 means one server (like a CDN or reverse proxy) could not get a proper reply from another.

What causes it?

  • Origin server down or overloaded
  • PHP-FPM or app process crashed
  • CDN or firewall misconfiguration
  • DNS changes not yet updated

Steps to try

Stop when the issue is resolved.

  1. Reload the page after a minute.
  2. Clear browser cache or try another browser.
  3. Flush DNS on your computer.
  4. Site owners: restart the web server and PHP-FPM.
  5. Site owners: check CDN (for example Cloudflare) origin settings and server logs.

Need more support? Check the official help: MDN Web Docs: HTTP response status codes

FAQs

Is 502 my internet's fault?

Rarely. It is almost always the website's servers.

How is 502 different from 504?

502 is an invalid reply; 504 is no reply in time.