Use it as the starting point for any web problem: identify the request, the status code, the headers and which hop (client, CDN, proxy, server, application) produced the response.
HTTP
1. Which URL, method and status code?
2. Which hop answered (Server/Via/Age headers, IP)?
3. Is it a redirect loop or a cached response?
4. For 5xx: what does the proxy's error log say about the upstream?
client → DNS → TCP/QUIC + TLS → CDN/proxy → virtual host → application → response headers and status → back through each intermediary
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Read-only Verification Verify boundary
# Status, headers and redirect chain
curl -sSIL https://www.example.com/
# Negotiated HTTP version and which IP answered
curl -sS -o /dev/null -w "code=%{http_code} version=%{http_version} ip=%{remote_ip}\n" https://www.example.com/
# Bypass DNS/CDN: send the request to a specific origin IP with the right Host and SNI
curl -sSI --resolve www.example.com:443:203.0.113.10 https://www.example.com/
# Full request/response headers, TLS and ALPN
curl -v https://www.example.com/ -o /dev/null
Comparing the public response with --resolve straight to the origin is the fastest way to tell whether a CDN or proxy, or the origin itself, produced a response. Use -L to follow redirects and look for loops (HTTP→HTTPS→HTTP, or www ↔ apex).
Step 2 Common mistakes Narrow the fault
- Diagnosing the application when a CDN or proxy produced the response.
- Using 302 for permanent moves, or 301/302 where the method must be preserved (use 308/307).
- Retrying non-idempotent requests in a load balancer.
- Trusting
X-Forwarded-Forfrom any client instead of only from known proxies. - Changing timeouts on one hop without aligning the others (client, CDN, proxy, application).
Step 3 Troubleshooting Narrow the fault
502 Bad Gateway. The proxy could not get a valid response: upstream down, wrong address or port, socket permission, TLS to the upstream failing, or the upstream closed the connection. Read the proxy's error log — it names the upstream and the reason.
504 Gateway Timeout. The upstream accepted the connection but did not answer within the proxy's read timeout. Compare the proxy timeout with the application's slowest legitimate request, and check the application side (worker saturation, database).
Wrong site or 404 on a valid URL. The request matched another virtual host or the default server — check the Host header, SNI and server_name/ServerName configuration.
Redirect loop. A proxy terminates TLS and talks HTTP to the application, which redirects back to HTTPS. Pass X-Forwarded-Proto and make the application trust it.
Works with curl, fails in the browser. Look at what differs: cookies, HTTP version (HTTP/3 vs TCP), cached responses, HSTS, CORS preflight (OPTIONS).
Subtopics
Go one level deeper into this subject.
HTTP/1.1 message syntax and connection management: persistent connections, Host, Content-Length vs chunked encoding, head-of-line blocking, Upgrade and request smuggling.
Subtopic HTTP/2HTTP/2 binary framing, streams and multiplexing over one TCP connection, HPACK, flow control, ALPN h2, h2c, server push status and enabling it in nginx, Apache and IIS.
Subtopic HTTP/3 and QUICHTTP/3 over QUIC: UDP transport, built-in TLS 1.3, independent streams, connection migration, 0-RTT, discovery via Alt-Svc and HTTPS DNS records, firewall and server support.
Subtopic WebSocketsWebSocket protocol: HTTP Upgrade handshake, 101 Switching Protocols, frames, ping/pong and close codes, wss, proxying through nginx/HAProxy, timeouts and origin checks.
Subtopic HTTP CachingHTTP caching per RFC 9111: freshness (max-age, s-maxage, Expires), validation with ETag/Last-Modified and 304, no-store vs no-cache vs private, Vary, Age, Cache-Status and nginx proxy_cache.
Semantics (RFC 9110) are version-independent. 1xx informational, 2xx success, 3xx redirect, 4xx client problem, 5xx server or gateway problem. 502/504 almost always come from a proxy talking to its upstream. Every intermediary can rewrite headers.
curl -sSI https://<host>/— status line, headers, redirects.curl -sS -o /dev/null -w "%{http_code} %{http_version} %{remote_ip}\n" https://<host>/— status, negotiated version, which IP answered.curl -v https://<host>/— request and response headers, TLS and ALPN.- Server access log for the same request (time, status, bytes, upstream time).
ReferenceWhat it is2 sections · depth on demand
Direct Answer
HTTP is a stateless request/response protocol. A client sends a request (method, target, header fields, optional body) and gets a response (status code, header fields, optional body). The meaning of all of this is defined once, in RFC 9110, and is the same for every version. HTTP/1.1 carries messages as text over TCP, HTTP/2 as binary frames multiplexed over one TCP connection, and HTTP/3 as frames over QUIC on UDP. Troubleshooting starts with three facts: the status code, the response headers and which hop produced them.
Scope and canonical references
This Topic owns HTTP semantics and is the parent of the version Topics.
- Versions: HTTP/1.1, HTTP/2, HTTP/3 and QUIC.
- Long-lived connections: WebSockets.
- Caching: HTTP Caching and Content Delivery Networks.
- HTTP in API automation: HTTP Methods and HTTP Status Codes under Automation → APIs.
- Security headers (HSTS, CSP): HTTP Security in Security.
- Packet-level view of QUIC and HTTP/3: QUIC & HTTP/3 Packet Evidence in Networking.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
Versions at a glance
| HTTP/1.1 | HTTP/2 | HTTP/3 | |
|---|---|---|---|
| Specification | RFC 9112 | RFC 9113 | RFC 9114 |
| Transport | TCP | TCP | QUIC over UDP |
| Encoding | Text | Binary frames | Binary frames |
| Concurrency | One request at a time per connection | Many streams on one connection | Many independent streams |
| Header compression | None | HPACK | QPACK |
| Encryption | Optional (TLS) | TLS in browsers (h2); cleartext h2c by prior knowledge | Always (TLS 1.3 inside QUIC) |
| Negotiation | — | ALPN h2 | Alt-Svc or HTTPS DNS record advertising h3 |
Methods
| Method | Safe | Idempotent | Typical use |
|---|---|---|---|
| GET | yes | yes | Read a resource |
| HEAD | yes | yes | Headers only |
| POST | no | no | Submit/create |
| PUT | no | yes | Replace |
| DELETE | no | yes | Remove |
| PATCH | no | no | Partial change |
| OPTIONS | yes | yes | Capabilities, CORS preflight |
Safe and idempotent matter operationally: proxies and load balancers may retry idempotent requests after a connection failure, but must not blindly retry POST.
Status codes that matter in operations
| Code | Usual meaning for an operator |
|---|---|
| 301 / 308 | Permanent redirect (308 keeps the method and body) |
| 302 / 307 | Temporary redirect (307 keeps the method and body) |
| 304 | Not Modified — a cache revalidated successfully |
| 400 | Malformed request, often header too large or a bad Host |
| 401 / 403 | Not authenticated / authenticated but not allowed |
| 404 | No such resource — or the wrong virtual host answered |
| 413 | Body too large (client_max_body_size, LimitRequestBody) |
| 421 | Misdirected Request — the connection was reused for a host this server does not serve |
| 429 | Rate limited |
| 500 | Application error |
| 502 | Proxy got an invalid or no response from the upstream |
| 503 | Service unavailable: overloaded, maintenance, or no healthy upstream |
| 504 | Proxy timed out waiting for the upstream |
Header fields to read first
Host (which site), Location (redirect target), Server and Via (which software/intermediaries), Age and Cache-Status (cache involvement), Cache-Control, ETag, Vary, Content-Type, Content-Length or Transfer-Encoding, Set-Cookie, Strict-Transport-Security, Alt-Svc (HTTP/3 offered), and X-Forwarded-For/Forwarded on requests reaching the origin through a proxy.
Intermediaries
A request often passes a CDN, a load balancer and a reverse proxy before reaching the application. Each is a separate HTTP client and server with its own timeouts, size limits, header rewriting and logs, and each may answer by itself (cached response, redirect, error page). Always establish which hop produced the response before changing configuration.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.