TL;DR

Remember: 2xx success, 3xx redirects, 4xx client errors (fix the request), 5xx server errors (check the server). Most common: 404, 403, 429, 500, 502, 504.

Classes

RangeMeaning
1xxInformational
2xxSuccess
3xxRedirection
4xxClient error
5xxServer error

Common Codes

CodeMeaningDebug
200OKNormal
201Created-
204No Content-
301 / 302Permanent / temporary redirectCheck Location
304Not ModifiedCache hit
400Bad RequestRequest format/params
401UnauthorizedMissing/invalid token
403ForbiddenPermissions, firewall, WAF
404Not FoundPath/resource missing
405Method Not AllowedWrong method
429Too Many RequestsRate limited; retry later
500Internal Server ErrorCheck server logs
502Bad GatewayUpstream down
503Service UnavailableOverload/maintenance
504Gateway TimeoutUpstream timeout

Rules of Thumb

FAQ

What's the difference between 401 and 403?

401 means unauthenticated (missing token or login); 403 means authenticated but not allowed, or blocked by WAF/firewall/CDN — check those before the app when you see 403.

What do 502 and 504 mean?

502 Bad Gateway: the upstream (backend process/port) is down or returned an invalid response. 504 Gateway Timeout: the upstream took too long. Debug the upstream first, then the proxy config.

Is 404 always a server problem?

No. 404 means the path or resource is missing — check the request URL and routing first, then confirm the file or endpoint is actually deployed.

How do I handle 429?

429 is rate limiting: wait and retry, or reduce request frequency. If a CDN/WAF is limiting you, check the triggering rule.

Does 304 mean an error?

No. 304 Not Modified is a cache hit — the browser or proxy uses the local cache. It is not an error.

Sources

最后更新:2026-08-04