Pcornel
Browse topics
Options
Recent
Favorites
Web Infrastructure · Technical reference

HTTP

Direct answer

HTTP is the request/response protocol of the web. Its semantics — methods, status codes, header fields, caching, content negotiation — are the same in every version; HTTP/1.1, HTTP/2 and HTTP/3 only change how messages are carried on the wire.

When to use this

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.

First 30 seconds

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?

Operational verification

client → DNS → TCP/QUIC + TLS → CDN/proxy → virtual host → application → response headers and status → back through each intermediary

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
HTTP per RFC 9110 (semantics); curl examples.
Applicability is projected only from persisted Topic profile and Command metadata.
At a glance

Operational reference

Fast context before you go deeper.

PlatformHTTP per RFC 9110 (semantics); curl examples.
Scope / prerequisiteUse it as the starting point for any web problem: identify the request, the status code, the headers and which hop (cli…
What next?2 suggested next steps
Child topics (this level)5
Evidence0
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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-For from 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).

Drill down

Subtopics

Go one level deeper into this subject.

Key points

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.

Key checks
  • 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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceImportant terms & boundaries1 section · depth on demand

In depth

Versions at a glance

HTTP/1.1HTTP/2HTTP/3
SpecificationRFC 9112RFC 9113RFC 9114
TransportTCPTCPQUIC over UDP
EncodingTextBinary framesBinary frames
ConcurrencyOne request at a time per connectionMany streams on one connectionMany independent streams
Header compressionNoneHPACKQPACK
EncryptionOptional (TLS)TLS in browsers (h2); cleartext h2c by prior knowledgeAlways (TLS 1.3 inside QUIC)
Negotiation—ALPN h2Alt-Svc or HTTPS DNS record advertising h3

Methods

MethodSafeIdempotentTypical use
GETyesyesRead a resource
HEADyesyesHeaders only
POSTnonoSubmit/create
PUTnoyesReplace
DELETEnoyesRemove
PATCHnonoPartial change
OPTIONSyesyesCapabilities, 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

CodeUsual meaning for an operator
301 / 308Permanent redirect (308 keeps the method and body)
302 / 307Temporary redirect (307 keeps the method and body)
304Not Modified — a cache revalidated successfully
400Malformed request, often header too large or a bad Host
401 / 403Not authenticated / authenticated but not allowed
404No such resource — or the wrong virtual host answered
413Body too large (client_max_body_size, LimitRequestBody)
421Misdirected Request — the connection was reused for a host this server does not serve
429Rate limited
500Application error
502Proxy got an invalid or no response from the upstream
503Service unavailable: overloaded, maintenance, or no healthy upstream
504Proxy 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
Terminology layer

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.

Aliases that resolve here
httphttp protocolhttp semanticshttp versionshttp headers
Confirmation

Confirm action

Continue?