chain
#
HTTP 502 Bad Gateway
⌃⏎ run · clear · / focus input
Meaning
send output to
no matches
Result appears here as you type
runs in your browser · nothing uploaded
// about this tool

HTTP 502 Bad Gateway Online

Updated 2026-07-26

HTTP 502 Bad Gateway means a proxy, load balancer, or CDN sitting in front of your application successfully forwarded a request, but got back an invalid or unreadable response from the origin server — or no usable response at all. The failure is happening one layer behind whatever served you the error page.

The fix starts at the origin, not the proxy: check whether the application server is actually running, hasn't crashed, and isn't refusing connections — a 502 is very often the proxy's way of reporting "I couldn't get a sensible answer from your app." For every other status code at once, use the full HTTP Status Codes reference.

// how to use

  1. 1 The code is already looked up below — 502 is pre-filled.
  2. 2 Type any other status code to look that one up instead.
  3. 3 Copy the result, or use the full HTTP Status Codes reference for every code at once.

// examples

The code itself
Input
502
Output
502 Bad Gateway — Server Error (5xx). A proxy or gateway got an invalid response from the upstream server.
A code it's often confused with
Input
500
Output
500 Internal Server Error — a failure inside the origin server itself, not a proxy relaying a bad reply.

// common uses

Debugging a reverse proxy or load balancer error Diagnosing why a CDN or API gateway is failing in front of a healthy-looking app Distinguishing an origin-server crash (500) from a broken proxy relay (502) Checking what a status code in server logs actually means

// faq

Is anything uploaded to a server?
No. The lookup runs entirely in your browser from a built-in table, so nothing you type leaves your machine.
What actually causes a 502?
A reverse proxy, load balancer, or CDN (nginx, Cloudflare, an API gateway) forwarded your request to an upstream/origin server and got back a response it couldn't understand — often because the origin crashed mid-response, returned malformed data, or refused the connection outright.
How is 502 different from 500?
500 comes directly from the application server itself, reporting its own internal failure. 502 comes from a proxy IN FRONT of that server, reporting that the server it's talking to gave a bad or no response — the failure is one layer removed.
How is 502 different from 504 Gateway Timeout?
502 means the upstream responded, but with something invalid or broken. 504 means the upstream never responded in time at all — the proxy gave up waiting. One is a bad reply, the other is no reply.
What's the first thing to check when debugging a 502?
Whether the origin server/application process is actually running and healthy — a 502 very often means the app crashed, is restarting, or is refusing connections, and the proxy is just the messenger.

Use this via API

Get a free API key →
curl -X POST https://thesnaptools.com/api/v1/tools/http-502 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"502"}'
Esc
↑↓ navigate open Esc close