Back to httpstatuses.net

500 vs 502 vs 503 vs 504 Server Errors

All four are server-side failures, but they point to different layers of the system.

Status codes in this guide

Quick comparison

CodeWhere to look firstMeaning
500Application logsThe origin server hit an unexpected error.
502Proxy and upstream logsA gateway received an invalid upstream response.
503Capacity and maintenance stateThe service is temporarily unavailable.
504Timeouts between proxy and upstreamA gateway waited too long for the upstream response.

Questions

Is 502 a client problem?

Usually no. 502 normally indicates a proxy, gateway, or upstream server problem.

Should clients retry 503?

Clients may retry 503 if the request is safe and the server provides Retry-After or documented backoff guidance.


HTTP status code lookup
By Ping Now, a website/API/service uptime monitor
Data from Wikipedia