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
| Code | Where to look first | Meaning |
| 500 | Application logs | The origin server hit an unexpected error. |
| 502 | Proxy and upstream logs | A gateway received an invalid upstream response. |
| 503 | Capacity and maintenance state | The service is temporarily unavailable. |
| 504 | Timeouts between proxy and upstream | A 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.