502 502 Bad Gateway

The server received an invalid response from an upstream server.

When you'll see it

When a proxy, load balancer or CDN got an invalid answer from the server behind it, typically because the application crashed, is restarting, or returned something malformed.

What to check

  • That the application process is running, and read its logs.
  • That the proxy points to the right host and port.
  • Whether it comes and goes during deploys. Health checks and rolling restarts help.
  • With a CDN, TLS settings between the CDN and your origin server.

Example response

HTTP/1.1 502 Bad Gateway
Server: nginx
Content-Type: text/html

SEO impact

Same as 500. It usually indicates infrastructure issues. Frequent 502s degrade crawl efficiency and risk deindexing.

At a glance

Status code502
Group5xx Server Errors
Class5xx