HTTP status codes chia thành 5 nhóm: 1xx info, 2xx success, 3xx redirect, 4xx client error, 5xx server error — các code quan trọng nhất là 401/403, 301/302, 502/504.
1xx (Informational): 100 Continue, 101 Switching Protocols (WebSocket upgrade).
2xx (Success): 200 OK, 201 Created, 204 No Content (DELETE thành công không có body).
3xx (Redirect): 301 Moved Permanently (SEO: cập nhật bookmark, search engine index URL mới), 302 Found (temporary, không thay đổi index), 303 See Other (sau POST → redirect GET), 304 Not Modified (cache valid, không gửi body).
4xx (Client Error): 400 Bad Request (invalid input), 401 Unauthorized (chưa authenticate — cần login), 403 Forbidden (đã authenticate nhưng không có quyền — không phải vấn đề login), 404 Not Found, 405 Method Not Allowed, 422 Unprocessable Entity (validation error trong REST API), 429 Too Many Requests (rate limited).
5xx (Server Error): 500 Internal Server Error (generic server bug), 502 Bad Gateway (reverse proxy nhận response invalid từ upstream server — upstream crash hoặc send malformed response), 503 Service Unavailable (server overloaded/maintenance), 504 Gateway Timeout (reverse proxy không nhận được response từ upstream trong thời gian quy định — upstream quá chậm).
HTTP status codes fall into 5 groups: 1xx info, 2xx success, 3xx redirect, 4xx client error, 5xx server error — the most important ones are 401/403, 301/302, and 502/504.
1xx (Informational): 100 Continue, 101 Switching Protocols (WebSocket upgrade).
2xx (Success): 200 OK, 201 Created, 204 No Content (successful DELETE with no body).
3xx (Redirect): 301 Moved Permanently (SEO: updates bookmarks and search index to new URL), 302 Found (temporary, doesn't change index), 303 See Other (after POST → redirect to GET), 304 Not Modified (cache is valid, no body sent).
4xx (Client Error): 400 Bad Request (invalid input), 401 Unauthorized (not authenticated — user needs to log in), 403 Forbidden (authenticated but lacks permission — not a login problem), 404 Not Found, 405 Method Not Allowed, 422 Unprocessable Entity (validation error in REST APIs), 429 Too Many Requests (rate limited).
5xx (Server Error): 500 Internal Server Error (generic server bug), 502 Bad Gateway (the reverse proxy received an invalid response from the upstream server — upstream crashed or sent a malformed response), 503 Service Unavailable (server overloaded or in maintenance), 504 Gateway Timeout (the reverse proxy did not receive a response from the upstream within the configured time — upstream is too slow).