Every time your web browser sends a request to a server, the server responds with a 3-digit number known as an HTTP Status Code. Whether your webpage loaded in 20 milliseconds (200 OK), permanently redirected to a new domain (301 Moved Permanently), or crashed due to an upstream proxy failure (502 Bad Gateway), these status codes are the universal status report of the web.
For developers, sysadmins, and SEO specialists, understanding HTTP status codes is essential for debugging broken API endpoints, protecting search engine crawl budgets, and diagnosing unexpected server outages.
"HTTP status codes are the server's vocabulary. If you can read what the server is saying, you can diagnose 99% of web bugs before even opening your application logs."
1. The 5 Status Code Categories
The first digit of any 3-digit status code defines the general category of the response:
2. 2xx Success Codes: The Golden Responses
- 200 OK: Standard response for successful HTTP requests. The payload contains the requested resource.
- 201 Created: The request was fulfilled and a new resource was created (standard for REST API
POSTrequests). - 204 No Content: The server successfully processed the request, but is intentionally returning no response body (common for
DELETEoperations).
3. 3xx Redirection: 301 vs. 302 for SEO
Understanding redirects is critical for search engine rankings. Choosing the wrong redirect type can destroy your domain's organic Google rankings:
301 Moved Permanently
Tells Google and browsers that the URL has permanently moved to a new location. Transfers 95-99% of SEO ranking juice (PageRank) to the destination URL.
Best for site redesigns & canonical URLs302 Found (Temporary)
Tells search engines the move is only temporary. Google will continue to index the old URL and does NOT transfer SEO ranking juice to the new target.
Best for A/B testing or temporary maintenance4. 4xx Client Errors: Something Wrong on the User's End
The server could not understand the request due to malformed syntax, invalid JSON payloads, or deceptive request routing.
401 means the user is not logged in (missing authentication token). 403 means the user IS logged in, but lacks permission to view that specific admin resource.
The most famous error on the internet. The server is reachable, but the requested URI path or file does not exist.
The user or bot has exceeded the server's API rate limits within a given time window.
5. 5xx Server Errors: The Server Crashed
5xx errors mean the client sent a valid request, but the backend server failed to process it:
- 500 Internal Server Error: Unhandled exceptions, fatal PHP errors, or database connection crashes.
- 502 Bad Gateway: The reverse proxy server (like Nginx, Cloudflare, or Apache) received an invalid response from the backend application (like PHP-FPM or Node.js).
- 503 Service Unavailable: The server is temporarily overloaded or down for scheduled maintenance.
- 504 Gateway Timeout: The backend server took too long to finish processing the database query or API call before the proxy gave up.
6. How to Diagnose & Fix a 502 Bad Gateway Error
- Check backend service status: Ensure PHP-FPM, Node.js, or your Python daemon is actively running (
sudo systemctl status php8.2-fpm). - Inspect proxy timeout configurations: Increase
fastcgi_read_timeoutorproxy_read_timeoutif long database imports are executing. - Audit HTTP response headers: Use our HTTP Headers Checker to see the exact status code returned by your origin server vs CDN edge.
Frequently Asked Questions
Conclusion
Mastering HTTP status codes gives you the diagnostic insight to build robust APIs, preserve SEO link equity, and fix server downtime in seconds.
Inspect live HTTP headers & status codes right now.
Verify your server's exact status response, redirects, and security headers.
Check HTTP Headers โ