Skip to main content

HTTP Status Codes

Complete reference of HTTP status codes with DevOps-focused explanations, common causes, and troubleshooting guidance for production systems.

Jump to category:

1xx — Informational

100

Continue

Server received request headers; client should proceed to send the body.

🔧 DevOps Cause: Normal behavior for large uploads; if stuck here, check proxy timeout settings for expect-continue headers.

101

Switching Protocols

Server is switching to a different protocol as requested by the client.

🔧 DevOps Cause: Seen during WebSocket upgrades. If failing, ensure your load balancer/reverse proxy supports WebSocket protocol upgrades.

102

Processing

Server has received and is processing the request, but no response is available yet.

🔧 DevOps Cause: Used with WebDAV. If requests hang here, the backend is taking too long — consider async processing or increasing timeouts.

103

Early Hints

Used to return some response headers before the final HTTP message.

🔧 DevOps Cause: Used for preloading resources. If not working, check CDN/proxy support for 103 responses.

2xx — Success

200

OK

The request succeeded. The response payload depends on the request method.

🔧 DevOps Cause: Expected healthy response. If health checks return 200 but the app seems broken, verify the health endpoint actually checks dependencies.

201

Created

The request succeeded, and a new resource was created.

🔧 DevOps Cause: Normal for POST/PUT requests creating resources. If not returned when expected, check API logic and database write permissions.

202

Accepted

The request has been accepted for processing, but processing is not complete.

🔧 DevOps Cause: Common in async architectures (queues, batch jobs). If consumers are down, requests may pile up — monitor queue depth.

204

No Content

The server successfully processed the request but returns no content.

🔧 DevOps Cause: Normal for DELETE operations. If your monitoring flags these as errors, adjust your status code alerting rules.

206

Partial Content

Server is delivering only part of the resource due to a range header.

🔧 DevOps Cause: Used for video streaming, large file downloads. If broken, check if your CDN/proxy correctly forwards Range headers.

3xx — Redirection

301

Moved Permanently

The resource has been permanently moved to a new URL.

🔧 DevOps Cause: Check Nginx/Apache rewrite rules. Redirect loops often come from misconfigured HTTP-to-HTTPS or www-to-non-www rules.

302

Found (Temporary Redirect)

The resource temporarily resides at a different URL.

🔧 DevOps Cause: Often used in OAuth flows. If login loops occur, check session/cookie settings and whether the redirect URI is correctly configured.

304

Not Modified

Resource has not been modified since the last request; use cached version.

🔧 DevOps Cause: Browser cache is working correctly. If stale content persists after a deploy, purge CDN cache or adjust Cache-Control headers.

307

Temporary Redirect

The request should be repeated with another URI, but future requests should still use the original.

🔧 DevOps Cause: Preserves request method unlike 302. If POST requests lose their body after redirect, switch from 302 to 307 in your reverse proxy config.

308

Permanent Redirect

The resource has permanently moved, and the request method must not change.

🔧 DevOps Cause: Like 301 but preserves method. Use when migrating API endpoints and you need POST/PUT requests to follow the redirect.

4xx — Client Error

400

Bad Request

The server cannot process the request due to a client error.

🔧 DevOps Cause: Malformed JSON, invalid query params, or request body too large. Check client payload and Nginx client_max_body_size.

401

Unauthorized

Authentication is required and has failed or not been provided.

🔧 DevOps Cause: Token expired, missing API key, or auth service down. Check if the identity provider is reachable and tokens are not stale.

403

Forbidden

The server understood the request but refuses to authorize it.

🔧 DevOps Cause: IAM/RBAC misconfiguration, IP allowlist blocking, or WAF rule triggered. Check security groups, NACLs, and WAF logs.

404

Not Found

The requested resource could not be found on the server.

🔧 DevOps Cause: Incorrect routing, missing ingress path, or deployment issue where new routes are not registered. Check ingress/route config.

405

Method Not Allowed

The request method is not supported for the requested resource.

🔧 DevOps Cause: CORS preflight misconfigured, or reverse proxy stripping/changing the HTTP method. Check allowed methods in route config.

408

Request Timeout

The server timed out waiting for the request from the client.

🔧 DevOps Cause: Client is too slow sending data. Common with mobile/slow networks. Adjust keep-alive and client timeout settings.

409

Conflict

The request conflicts with the current state of the target resource.

🔧 DevOps Cause: Concurrent writes, optimistic locking failures, or resource already exists. Check database constraints and retry logic.

413

Payload Too Large

The request entity is larger than the server is willing to process.

🔧 DevOps Cause: Nginx default is 1MB. Increase client_max_body_size in Nginx or adjust body-size annotation in K8s ingress.

414

URI Too Long

The URI provided was too long for the server to process.

🔧 DevOps Cause: Query strings too large. Consider switching to POST with a body. Check large_client_header_buffers in Nginx.

415

Unsupported Media Type

The media format of the request is not supported by the server.

🔧 DevOps Cause: Missing or wrong Content-Type header. Ensure clients send the correct header and the API accepts the format.

422

Unprocessable Entity

The request was well-formed but semantically invalid.

🔧 DevOps Cause: Validation error in the application layer. Check API schema validation rules and input constraints.

429

Too Many Requests

The user has sent too many requests in a given time period.

🔧 DevOps Cause: Rate limiter triggered (Nginx limit_req, API gateway throttle, or app-level). Check rate limit config and consider increasing for legitimate traffic.

5xx — Server Error

500

Internal Server Error

A generic error when the server encounters an unexpected condition.

🔧 DevOps Cause: Unhandled exception in application code. Check application logs, recent deployments, and environment variable changes.

502

Bad Gateway

The server acting as a gateway received an invalid response from upstream.

🔧 DevOps Cause: Upstream server not responding or crashed. Check reverse proxy/load balancer config, upstream health, and if the backend process is running.

503

Service Unavailable

The server is currently unable to handle the request due to overload or maintenance.

🔧 DevOps Cause: Server overloaded, in maintenance mode, or failing health checks. Check pod readiness, auto-scaling, and circuit breakers.

504

Gateway Timeout

The server acting as a gateway did not receive a timely response from upstream.

🔧 DevOps Cause: Backend took too long to respond. Increase proxy_read_timeout in Nginx, check slow DB queries, or optimize the endpoint.

505

HTTP Version Not Supported

The server does not support the HTTP protocol version used in the request.

🔧 DevOps Cause: Rare — usually means a very old client or misconfigured proxy. Check if your reverse proxy is forcing an HTTP version mismatch.

507

Insufficient Storage

The server is unable to store the representation needed to complete the request.

🔧 DevOps Cause: Disk full on the server. Check disk usage, log rotation, and PV (Persistent Volume) capacity in Kubernetes.

520

Web Server Returned an Unknown Error

Cloudflare-specific: The origin server returned an unexpected response.

🔧 DevOps Cause: Origin server crashed or returned empty/malformed response. Check origin server logs and ensure it is running properly.

521

Web Server Is Down

Cloudflare-specific: The origin server refused the connection.

🔧 DevOps Cause: Origin server is down or blocking Cloudflare IPs. Verify the server is running and Cloudflare IP ranges are allowlisted.

522

Connection Timed Out

Cloudflare-specific: TCP connection to the origin server timed out.

🔧 DevOps Cause: Network issue between CDN and origin. Check firewall rules, security groups, and network connectivity to the origin.

523

Origin Is Unreachable

Cloudflare-specific: DNS points to an unreachable origin.

🔧 DevOps Cause: DNS records point to a wrong IP or the origin server's network is down. Verify DNS A/AAAA records and origin IP.

Quick Reference

CodeNameCategory
100ContinueInformational
101Switching ProtocolsInformational
102ProcessingInformational
103Early HintsInformational
200OKSuccess
201CreatedSuccess
202AcceptedSuccess
204No ContentSuccess
206Partial ContentSuccess
301Moved PermanentlyRedirection
302Found (Temporary Redirect)Redirection
304Not ModifiedRedirection
307Temporary RedirectRedirection
308Permanent RedirectRedirection
400Bad RequestClient Error
401UnauthorizedClient Error
403ForbiddenClient Error
404Not FoundClient Error
405Method Not AllowedClient Error
408Request TimeoutClient Error
409ConflictClient Error
413Payload Too LargeClient Error
414URI Too LongClient Error
415Unsupported Media TypeClient Error
422Unprocessable EntityClient Error
429Too Many RequestsClient Error
500Internal Server ErrorServer Error
502Bad GatewayServer Error
503Service UnavailableServer Error
504Gateway TimeoutServer Error
505HTTP Version Not SupportedServer Error
507Insufficient StorageServer Error
520Web Server Returned an Unknown ErrorServer Error
521Web Server Is DownServer Error
522Connection Timed OutServer Error
523Origin Is UnreachableServer Error

What are HTTP Status Codes?

HTTP status codes are three-digit numbers returned by web servers to indicate the outcome of an HTTP request. They are grouped into five categories: 1xx (Informational), 2xx (Success), 3xx (Redirection), 4xx (Client Error), and 5xx (Server Error). Understanding these codes is essential for debugging web applications, APIs, load balancers, and microservice architectures where multiple services communicate over HTTP.

DevOps engineers, backend developers, and SREs use HTTP status codes daily when troubleshooting production issues, configuring health checks, setting up monitoring alerts, and analyzing access logs. A 502 Bad Gateway in your monitoring dashboard tells a completely different story than a 429 Too Many Requests—each code points to a specific layer in your stack where the problem originated. This reference helps you quickly identify what went wrong and where to look for the root cause.

Frequently Asked Questions

What is the difference between 401 and 403?

A 401 Unauthorized means the request lacks valid authentication credentials—the user needs to log in or provide a valid token. A 403 Forbidden means the user is authenticated but does not have permission to access the resource. In practice: 401 means "who are you?" while 403 means "I know who you are, but you can't access this."

What causes a 502 Bad Gateway?

A 502 Bad Gateway occurs when a reverse proxy or load balancer (like Nginx, AWS ALB, or Cloudflare) receives an invalid response from an upstream server. Common causes include: the upstream application crashed, the container was restarted, connection timeouts due to slow responses, or misconfigured proxy_pass targets. Check upstream application logs and ensure the backend service is running and healthy.

What does 503 Service Unavailable mean?

A 503 Service Unavailable indicates the server is temporarily unable to handle the request, usually due to maintenance or overload. Unlike a 500 (which suggests a bug), a 503 is often intentional and temporary. Load balancers return 503 when all backend targets are unhealthy, and applications may return it during graceful shutdowns or when circuit breakers are open.