How to Migrate from HTTP/2 to HTTP/3 and QUIC
Enable Alt-Svc discovery, run QUIC over UDP 443, verify with curl, and constrain 0-RTT early data to idempotent requests during migration.
On this page
Introduction
HTTP/3 replaces the TCP transport under HTTP with QUIC, a UDP-based protocol that carries TLS 1.3 internally, gives every stream its own loss recovery, and lets a connection survive an IP address change. The practical payoffs are three: eliminating transport head-of-line blocking, where one lost packet stalls every multiplexed stream on a TCP connection; combining the TCP and TLS handshakes into one round trip, with an optional zero-round-trip resumption; and connection migration, which keeps a download alive when a phone switches from Wi-Fi to cellular. Migration is deliberately incremental: clients discover the HTTP/3 endpoint through the Alt-Svc header on an ordinary HTTP/2 connection, and the TCP path remains for everyone else. This tutorial covers what changes at each layer, the Alt-Svc discovery dance, server-side enablement at the edge, the verification steps with curl, and the two hazards that deserve respect during rollout: UDP-hostile middleboxes and the replay exposure of 0-RTT early data.
What QUIC changes underneath
HTTP/2 multiplexed streams over one TCP connection, which solved the browser connection limit but inherited a transport flaw: TCP delivers bytes in order, so when one packet is lost, every stream sharing the connection stalls until the retransmission arrives, even streams whose bytes were already delivered. QUIC moves framing, acknowledgment, and loss recovery into the protocol itself over UDP, and tracks loss per stream: a lost packet stalls only the stream it carried, and other streams continue. QUIC also integrates TLS 1.3 as a sublayer rather than layering TLS above the transport, which collapses connection establishment to one round trip and makes the cryptographic state part of the connection identity. That identity enables migration: a QUIC connection is identified by a connection ID rather than the four-tuple of addresses and ports, so the endpoint can move networks and resume the same connection. The cost is that QUIC reimplements what kernels do for TCP in user space, which is why early server implementations consumed notable CPU and why hardware offload for QUIC is an active area.
Discovery through Alt-Svc
No client speaks HTTP/3 first. The browser connects over TCP, negotiates HTTP/2 as usual, and receives an Alt-Svc header declaring that the same origin is available over HTTP/3 on a given port. The next connection, or a subsequent one after the entry’s lifetime, uses QUIC, with the TCP path held in reserve. The header is the entire migration mechanism, which is what makes the migration low-risk.
Alt-Svc: h3=":443"; ma=86400
Alt-Svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
The ma parameter is the cache lifetime in seconds, controlling how long the client remembers the advertisement. The port may differ from 443, though sharing 443 between TCP and UDP is the common deployment because it simplifies firewall expectations. There is no need to advertise aggressively: a one-day lifetime is typical, and clients that cannot use the entry simply ignore it. Servers should also honor the upgrade race gracefully, meaning a client may race the QUIC attempt against TCP on the first connection after expiry, and both paths must answer correctly and identically.
Enable it at the edge
Terminating QUIC belongs at the edge: the CDN, the load balancer, or the reverse proxy, with the origin unchanged behind it. That keeps the origin stack untouched and confines the new protocol to the layer that already handles TLS termination. In nginx, HTTP/3 support arrives with a listen directive addition and QUIC replay protection enabled; in Caddy it is a single line per site. The essence is the same everywhere: listen on UDP 443 in addition to TCP 443, and serve identical content on both.
server {
listen 443 quic reuseport;
listen 443 ssl;
http2 on;
ssl_protocols TLSv1.3;
add_header Alt-Svc 'h3=":443"; ma=86400' always;
}
The reuseport directive spreads QUIC listeners across worker processes, mirroring what kernels do for TCP accept queues. Firewall and security-group rules are the deployment step most often missed: UDP 443 must be open end to end, and intermediaries that only model TCP will silently drop the traffic, which surfaces as negotiation failures rather than errors. Verify the path with a client before declaring rollout, and monitor the QUIC handshake failure rate as a first-class metric.
Verify with curl and telemetry
curl with HTTP/3 support answers the basic question directly.
curl -sI --http3-only -v https://example.com/ 2>&1 | grep -iE 'quic|http/3|alt-svc'
curl -sI --http3 https://example.com/ | head -1
The verbose output shows the QUIC version negotiated, the handshake time, and the Alt-Svc entries observed. Browser-side verification uses the protocol column in the network panel and the connection viewer, which lists h3 for upgraded connections. Server-side, the protocol mix is the rollout metric: the fraction of requests arriving over HTTP/3, HTTP/2, and HTTP/1.1, plus QUIC handshake failures and 0-RTT acceptance rates where supported. Two failure modes deserve distinct alerts: zero HTTP/3 traffic despite Alt-Svc being served, which means discovery or UDP reachability is broken; and high handshake failure among attempts, which points at middleboxes, MTU issues, or version mismatch. Watch also the comparison that justifies the whole effort: connection establishment latency and stream stall rates versus HTTP/2 on equivalent traffic.
Constrain 0-RTT during rollout
QUIC inherits the TLS 1.3 early-data option: a returning client can send application data in its first flight, achieving a zero-round-trip request on resumed connections. The option carries the same replay exposure as in TLS 1.3 over TCP, and an on-path observer can replay the first flight verbatim. The discipline is unchanged from TLS 1.3: early data must be restricted to idempotent requests, reads without side effects, or requests carrying replay protection such as one-time tokens. In practice most servers and CDNs default 0-RTT to off or to a limited anti-replay window, and the safe migration posture is to leave it off until a deliberate decision exists for which endpoints may accept it. The 1-RTT handshake of QUIC is already a full round trip faster than TCP plus TLS 1.3’s two, so the marginal latency of keeping early data off is small compared with the replay surface it avoids. Where it is enabled, monitor rejection rates from anti-replay windows: a high rejection rate is either an attacker probing or client retry logic interacting badly with the window, and both deserve investigation rather than silence.
Roll out in measured stages
The migration has a natural sequence that keeps every step reversible. Stage one: serve Alt-Svc from a small fraction of responses, or from a canary hostname, and measure how many clients upgrade and whether their sessions perform comparably. Stage two: advertise broadly while keeping UDP 443 capacity headroom, watching handshake failures for middlebox interference patterns, which differ by network and region. Stage three: enable 0-RTT selectively for idempotent endpoints if the latency data justifies it. Throughout, the TCP path is never removed: it serves older clients, UDP-blocked networks, and every failure fallback, and it should be load-tested with the assumption that a QUIC incident could shift all traffic back to it instantly. The rollback story is the strength of this migration, since disabling the Alt-Svc header returns clients to HTTP/2 within the advertisement’s lifetime, and the QUIC listener can be drained without touching the origin.
Common pitfalls
- Firewalling TCP 443 only. QUIC rides UDP; an unopened UDP path means negotiation silently fails and the investment pays nothing.
- Forgetting the fallback. The TCP listener must carry full load the moment QUIC hiccups; capacity plans that ignore this invert during incidents.
- 0-RTT on mutating requests. Early data is replayable; restrict it to idempotent endpoints or leave it off.
- Judging by handshake specs, not traffic. Server support means nothing until telemetry shows the negotiated protocol mix shifting.
- Assuming linear speedups. The gains concentrate on lossy, high-latency paths and stream-heavy workloads; a fast clean network may show little difference.
- Skipping version pinning. QUIC versions differ; deploy the version clients actually negotiate and track mismatches.
Conclusion
HTTP/3 is a transport swap negotiated politely: QUIC over UDP fixes stream-level head-of-line blocking, folds TLS 1.3 into a single round trip, and lets connections migrate across networks, while Alt-Svc lets each client opt in on its own schedule. Roll it out at the edge with UDP 443 open, advertise with a sane lifetime, and keep the TCP path fully loaded as both fallback and majority path during the transition. Verify with curl and a protocol-mix metric rather than configuration presence, alert on handshake failures as the middlebox signal they are, and treat 0-RTT as a separate, deliberate decision confined to idempotent requests. Measured this way, the migration is additive, reversible, and justified by the connection-latency and stream-stall numbers it was undertaken for.
Sources: RFC 9000: QUIC transport, RFC 9114: HTTP/3, MDN: HTTP/3 glossary.
FAQ
- Does HTTP/3 require abandoning TCP?
- For the HTTP/3 connection itself, yes: QUIC runs over UDP. But migration is additive, not a replacement. The TCP path with HTTP/2 and HTTP/1.1 stays live for every client that has not upgraded, and Alt-Svc negotiates per client.
- What does QUIC fix that HTTP/2 does not?
- Transport-level head-of-line blocking: one lost packet stalls only its own QUIC stream, not every multiplexed stream sharing a TCP connection. It also folds TLS 1.3 into the protocol and supports connection migration across IP changes.
- Is UDP blocked on some networks?
- Yes, some middleboxes and corporate networks throttle or block UDP, which is exactly why the TCP fallback remains mandatory. Migration telemetry should track negotiation failures, not just successes.
Report a problem with this articleOpens a pre-filled issue on GitHub.