What Happens When You Type a URL and Press Enter
DNS lookups, TCP and TLS handshakes, HTTP requests, servers, and the browser's rendering pipeline. The whole journey of a web page, explained so it finally clicks.
Read →There are dozens of HTTP status codes, but about fifteen cover nearly everything. What each one means, when to return it, and the mix-ups (401 vs 403, 301 vs 302) that confuse everyone.
Every HTTP response starts with a three-digit number that tells the client what happened. Get these right and browsers, search engines, caches, monitoring tools and frontend code all behave sensibly. Get them wrong, like returning 200 OK with an error message inside, and you create bugs that are surprisingly hard to track down.
The first digit tells you the category:
| Range | Meaning |
|---|---|
| 1xx | Informational. Rarely something you handle directly. |
| 2xx | Success. |
| 3xx | Redirection. Look somewhere else. |
| 4xx | Client error. The request was wrong. |
| 5xx | Server error. The server failed. |
Even a client that doesn't recognise a specific code knows how to treat it from its family.
Location header.POST shouldn't silently become a GET.ETag or Last-Modified. It saves bandwidth. (Caching strategies.)A classic mistake is using 302 for permanent moves. The page might still rank, but you're sending mixed signals. If it's permanent, use 301 (or 308).
DELETE on a read-only resource).Retry-After header. (Rate limiting guide.)Retry-After if you know when it'll be back.When you see 502 or 504 from Nginx or a hosting platform, the problem is almost always the application behind it, not the proxy itself. (Reading errors effectively.)
200 with {"error": "..."}. Monitoring sees success, caches may store the error, and clients have to parse every body to find out what happened.For designing APIs around these codes, see REST API design best practices.
401 means the request isn't authenticated, so the client should log in. 403 means the client is authenticated but doesn't have permission, so logging in again won't help.
Use 301 (or 308) for permanent moves so search engines transfer signals to the new URL. Use 302 (or 307) only for genuinely temporary redirects.
A proxy or load balancer received an invalid response from the server behind it, typically because the application crashed, isn't running, or is listening on a different port.
DNS lookups, TCP and TLS handshakes, HTTP requests, servers, and the browser's rendering pipeline. The whole journey of a web page, explained so it finally clicks.
Read →A, AAAA, CNAME, MX, TXT and NS records in plain English, why DNS changes seem slow, and the troubleshooting commands that tell you what is really going on.
Read →