← All status codes
5xx Server Error
502 Bad Gateway

The server received an invalid response from an upstream server.

What it means

A 502 Bad Gateway response means the server, while acting as a gateway or proxy, received an invalid response from a server it was trying to reach. This is common with reverse proxies and CDNs when the origin server is down or returning malformed responses.

Common causes

  • The origin server crashed or is unreachable.
  • A reverse proxy like nginx cannot connect to the upstream application server.
  • The application server returned an invalid HTTP response.
  • A CDN is having trouble reaching its origin.

How to fix it

  • If you are a visitor, refresh the page or try again in a few minutes.
  • If you are the site owner, check that the upstream application server is running.
  • Review proxy configuration and upstream connectivity.
  • Check application logs for crashes or errors.

Test a URL and see its actual status code now.

Open the checker →