← Back to Home

Explaining the "502 Bad Gateway" Error

The HTTP 502 Bad Gateway error indicates that one server on the internet received an invalid or unexpected response from another server it was accessing while trying to load the web page.

Track Down Upstream Servers

Use our free IP Lookup Tool to verify the organization and ISP of the server failing to respond behind the proxy.

[Image of HTTP 502 Bad Gateway origin server diagram]

What It Means

Think of the internet as a chain of servers passing your request along. Server A acts as a "gateway" or "proxy," and the problem lies with the "upstream" server (Server B) it tried to communicate with. A 502 error means Server A received a bad, incomplete, or nonsensical response from Server B.

Common Causes

How to Fix (For Server Admins)

  1. Check Origin Server Status & Load: Verify the main web/application server is online and not overloaded.
  2. Review Server Logs: Examine error logs on *both* the gateway server (Nginx proxy) and the origin server.
  3. Review Proxy/Gateway Configuration: Double-check the upstream server address, port, and health check settings in your proxy configuration.