Standardized three-digit codes returned by HTTP servers to indicate the result of a client request.

Table of Contents#

  1. Overview
  2. 1xx Informational
  3. 2xx Success
  4. 3xx Redirection
  5. 4xx Client Errors
  6. 5xx Server Errors
  7. Non-Standard Codes
  8. HTTP/2 and HTTP/3 Notes
  9. Troubleshooting
  10. See Also
  11. Sources

1. Overview#

HTTP status codes are defined primarily in RFC 9110 (HTTP Semantics). Every HTTP response includes a three-digit status code grouped into five classes by the first digit. Servers, proxies, and load balancers all use these codes to communicate the outcome of a request. Understanding them is essential for debugging web applications, configuring reverse proxies, and writing API clients.

2. 1xx Informational#

Informational responses indicate that the request was received and the server is continuing to process it. The client should wait for a final response. These are interim responses; no body is included.

CodeNameDescriptionCommon Use Case
100ContinueThe initial part of the request was received; the client should continue sending the body.Large file uploads with Expect: 100-continue header
101Switching ProtocolsThe server is switching to the protocol requested via the Upgrade header.WebSocket handshake (Upgrade: websocket)
102ProcessingThe server has received the request and is still processing it (WebDAV).Long-running WebDAV operations
103Early HintsAllows the server to send preliminary headers before the final response.Preloading CSS/JS via Link headers while the server prepares the response

3. 2xx Success#

Success codes indicate that the request was received, understood, and accepted.

CodeNameDescriptionCommon Use Case
200OKThe request succeeded. The meaning depends on the HTTP method used.Standard successful GET, POST, PUT responses
201CreatedThe request succeeded and a new resource was created.REST API after successful POST creating a resource
202AcceptedThe request was accepted for processing, but processing is not complete.Asynchronous job queues, batch operations
203Non-Authoritative InformationThe response metadata is from a local or third-party copy, not the origin server.Responses modified by a transforming proxy
204No ContentThe request succeeded but there is no content to return.Successful DELETE requests, form submissions without redirect
205Reset ContentThe server asks the client to reset the document that sent the request.Form reset after submission
206Partial ContentThe server is delivering only a portion of the resource due to a Range header.Video streaming, resumable downloads
207Multi-StatusConveys information about multiple resources in a single response (WebDAV).Batch operations returning per-item status
208Already ReportedMembers of a DAV binding were already enumerated in a previous part of a multi-status response.Avoiding duplicate entries in WebDAV responses
226IM UsedThe server fulfilled a GET request using instance manipulations (delta encoding).Efficient resource updates via RFC 3229

4. 3xx Redirection#

Redirection codes indicate the client must take additional action to complete the request, usually following a Location header.

CodeNameDescriptionCommon Use Case
300Multiple ChoicesThe request has more than one possible response; the client should choose.Content negotiation with multiple representations
301Moved PermanentlyThe resource has been permanently moved to a new URL. Search engines update their index.Domain migration, HTTP-to-HTTPS redirect
302FoundThe resource is temporarily at a different URI. The original URI should still be used for future requests.Temporary redirect during maintenance
303See OtherThe server directs the client to retrieve the resource at another URI via GET.Redirect after POST (Post/Redirect/Get pattern)
304Not ModifiedThe resource has not changed since the version specified by If-None-Match or If-Modified-Since.Browser cache validation, CDN cache revalidation
305Use ProxyThe requested resource must be accessed through a proxy (deprecated).Discontinued; do not use
307Temporary RedirectSame as 302, but the client must not change the HTTP method on redirect.API temporary redirects preserving POST method
308Permanent RedirectSame as 301, but the client must not change the HTTP method on redirect.Permanent API endpoint migration preserving method

Key difference between 301/302 and 307/308: The older codes (301, 302) historically allowed clients to change POST to GET on redirect. The newer codes (307, 308) strictly preserve the original method.

5. 4xx Client Errors#

Client error codes indicate the request contains an error or cannot be fulfilled as sent.

CodeNameDescriptionCommon Use Case
400Bad RequestThe server cannot process the request due to malformed syntax.Invalid JSON body, missing required parameters
401UnauthorizedThe client must authenticate to access the resource. Includes a WWW-Authenticate header.Missing or expired authentication token
402Payment RequiredReserved for future use. Occasionally used for paywall or quota-exceeded responses.API billing limits, premium content gates
403ForbiddenThe client is authenticated but lacks permission to access the resource.Insufficient role or scope for the requested action
404Not FoundThe server cannot find the requested resource.Wrong URL, deleted resource
405Method Not AllowedThe HTTP method is recognized but not allowed for this resource. Must include an Allow header.Sending POST to a read-only endpoint
406Not AcceptableThe server cannot produce a response matching the Accept headers sent by the client.Requesting XML from a JSON-only API
407Proxy Authentication RequiredSimilar to 401, but the client must authenticate with an intermediate proxy.Corporate proxy requiring credentials
408Request TimeoutThe server timed out waiting for the client to finish sending the request.Slow or stalled client connections
409ConflictThe request conflicts with the current state of the resource.Concurrent edit conflict, duplicate resource creation
410GoneThe resource has been permanently removed with no forwarding address. Unlike 404, this is intentional.Deliberately retired API endpoints
411Length RequiredThe server requires a Content-Length header that was not provided.Uploads without content length
412Precondition FailedA condition in the request headers (If-Match, If-Unmodified-Since) evaluated to false.Optimistic concurrency control failure
413Content Too LargeThe request body exceeds the server's size limit.File upload exceeding client_max_body_size
414URI Too LongThe request URI exceeds the server's length limit.Extremely long query strings
415Unsupported Media TypeThe media type in Content-Type is not supported by the server.Sending XML to a JSON-only endpoint
416Range Not SatisfiableThe Range header specifies a range outside the resource's size.Requesting bytes beyond end of file
417Expectation FailedThe server cannot meet the Expect header requirements.Expect: 100-continue rejected
418I'm a TeapotThe server refuses to brew coffee because it is a teapot (RFC 2324).Easter egg, API humor
421Misdirected RequestThe request was directed at a server unable to produce a response for the target URI.HTTP/2 connection coalescing mismatch
422Unprocessable ContentThe request is syntactically valid but semantically incorrect.Validation errors in a well-formed JSON body
423LockedThe resource is currently locked (WebDAV).Concurrent editing protection
424Failed DependencyThe request failed because a prerequisite request failed (WebDAV).Batch operation where a dependency failed
426Upgrade RequiredThe server refuses the current protocol; the client must upgrade (e.g., to TLS).Forcing HTTPS or HTTP/2 upgrade
428Precondition RequiredThe server requires conditional headers (If-Match) to prevent lost updates.Protecting against concurrent modifications
429Too Many RequestsThe client has exceeded the rate limit. May include a Retry-After header.API rate limiting, brute force protection
431Request Header Fields Too LargeThe server refuses the request because headers are too large.Oversized cookies or authorization headers
451Unavailable For Legal ReasonsThe resource is unavailable due to legal demands (e.g., government censorship).DMCA takedowns, geo-restricted content

6. 5xx Server Errors#

Server error codes indicate the server failed to fulfill a valid request.

CodeNameDescriptionCommon Use Case
500Internal Server ErrorA generic server error when no more specific code applies.Unhandled exception in application code
501Not ImplementedThe server does not support the HTTP method used.Server lacks PATCH or DELETE support
502Bad GatewayThe server, acting as a gateway or proxy, received an invalid response from the upstream.Backend crashed or returned malformed response
503Service UnavailableThe server is temporarily unable to handle the request (overloaded or in maintenance).Deployment in progress, circuit breaker open
504Gateway TimeoutThe server, acting as a gateway or proxy, did not receive a timely response from the upstream.Backend took too long to respond
505HTTP Version Not SupportedThe server does not support the HTTP version used in the request.Client using HTTP/0.9 against a modern server
506Variant Also NegotiatesCircular reference in transparent content negotiation.Misconfigured content negotiation
507Insufficient StorageThe server cannot store the representation needed to complete the request (WebDAV).Disk full during file upload
508Loop DetectedThe server detected an infinite loop while processing the request (WebDAV).Circular symlinks or recursive bindings
510Not ExtendedFurther extensions to the request are required for the server to fulfill it.Missing required HTTP extension
511Network Authentication RequiredThe client must authenticate to gain network access.Captive portal (hotel/airport WiFi)

7. Non-Standard Codes#

These codes are not part of any RFC but are used by specific software. They may appear in logs from Nginx, Cloudflare, or other infrastructure.

CodeNameOriginDescription
444Connection Closed Without ResponseNginxNginx closed the connection without sending a response. Used to reject malicious requests.
499Client Closed RequestNginxThe client closed the connection before the server finished responding.
520Web Server Returned an Unknown ErrorCloudflareThe origin returned an unexpected response.
521Web Server Is DownCloudflareThe origin server refused the connection from Cloudflare.
522Connection Timed OutCloudflareCloudflare could not establish a TCP connection to the origin.
523Origin Is UnreachableCloudflareCloudflare could not reach the origin due to DNS errors.
524A Timeout OccurredCloudflareCloudflare established a TCP connection but the origin did not respond in time.
525SSL Handshake FailedCloudflareCloudflare could not complete an SSL/TLS handshake with the origin.
599Network Connect Timeout ErrorNon-standardConnection timed out due to an overloaded server or infrastructure error.

8. HTTP/2 and HTTP/3 Notes#

HTTP/2 and HTTP/3 use the same status codes as HTTP/1.1, but there are behavioral differences worth noting:

  • No 101 Switching Protocols in HTTP/2 or HTTP/3. Protocol negotiation happens at the TLS layer via ALPN (Application-Layer Protocol Negotiation), not via the Upgrade header. WebSocket over HTTP/2 uses the CONNECT method instead (RFC 8441).
  • 421 Misdirected Request becomes more relevant in HTTP/2, where connection coalescing may cause a client to reuse a connection for a different hostname. The server returns 421 to signal the client should open a new connection.
  • HTTP/3 (QUIC) uses UDP instead of TCP. Status codes remain identical, but transport-level errors (connection migration, packet loss) are handled below the HTTP layer and do not produce HTTP status codes.
  • 103 Early Hints is particularly useful with HTTP/2 server push deprecation, allowing servers to suggest preloading resources before the final response is ready.
  • GOAWAY frame (HTTP/2) and CONNECTION_CLOSE frame (HTTP/3) are not HTTP status codes but transport-level signals that a connection is being closed. They may appear in logs alongside status codes.

Troubleshooting#

IssueCauseSolution
Seeing 502 in reverse proxy logsBackend server is down or returning invalid responseCheck backend health; verify upstream address and port
504 during peak trafficBackend processing time exceeds proxy timeoutIncrease proxy_read_timeout (Nginx) or timeout server (HAProxy)
301 redirect loopMisconfigured HTTP-to-HTTPS redirect with proxySet X-Forwarded-Proto and check it before redirecting
413 on file uploadsServer body size limit too lowIncrease client_max_body_size (Nginx) or tune.bufsize (HAProxy)
429 from APIClient exceeding rate limitsImplement backoff; check Retry-After header
499 in Nginx logsClient disconnected before server finishedUsually benign; investigate if frequent (slow backends)
400 on valid-looking requestsOversized headers or malformed encodingCheck cookie sizes; increase large_client_header_buffers

See Also#

Sources#