The first digit gives the class:
- 1xx: informational, e.g. 101 when switching to WebSocket
- 2xx: success, e.g. 200 OK or 207 Multi-Status in WebDAV
- 3xx: redirect, e.g. 301 permanent, 302 and 307 temporary
- 4xx: client-side error, e.g. 401, 403, 404, 413, 429
- 5xx: server-side error, e.g. 500, 502, 503, 504
When debugging behind a reverse proxy, it matters who produced the code. A 502 or 504 almost always comes from the proxy and means the backend did not answer, or answered too slowly. A 500 usually comes from the application itself, whose log then shows the cause.
Example
curl -sI https://example.com/ | head -n 1