SiteCheck home / Help centre

How to Fix a 502 Bad Gateway Error

Learn why a 502 Bad Gateway error occurs between servers, proxies, CDNs, and applications and how to diagnose it.

A 502 Bad Gateway error means a gateway or proxy received an invalid response from an upstream server.

Common causes

  • The application server is stopped or restarting.
  • The upstream server timed out or returned malformed data.
  • A reverse proxy or CDN points to the wrong origin.
  • DNS, TLS, or network connectivity between services is failing.

How to investigate

  1. Check your hosting provider's status page for an incident.
  2. Inspect application logs and proxy/CDN origin logs for the same timestamp.
  3. Confirm the application process is running and listening on the expected port.
  4. Verify origin hostnames, DNS records, TLS settings, and proxy configuration.
  5. Restart or redeploy only after checking logs and the likely cause.

If you are only a visitor, retry after a short wait or contact the website owner. Repeated refreshes cannot fix a persistent upstream problem.

Check your website for related issues

SiteCheck can review publicly observable SEO, security configuration, accessibility, performance, and link signals. Automated results are a starting point and may need manual confirmation.

Start a website audit — $15.99 CAD

More help guides