HTTP 502 Bad Gateway

HTTP 502 Bad Gateway indicates a server errors response outcome.

What it means

Bad Gateway describes how the server processed the request and what the client should do next.

Why it happens

Common triggers include protocol conditions, routing decisions, and application behavior.

Common causes

  • Unhandled server-side exception
  • Upstream service failure
  • Runtime configuration issue

How to fix it

  • Review application and proxy logs
  • Rollback or patch unstable deployments
  • Check upstream dependencies and timeouts

Example request/response

GET /example HTTP/1.1
Host: errorlookup.com

HTTP/1.1 502 Bad Gateway

Browser/dev/server context

Use browser network tools, server logs, and APM traces together when diagnosing HTTP 502.

Related status codes

FAQ

Is HTTP 502 officially assigned?

Yes. This code is assigned in the IANA registry.