Migration Guide: HTTP/2 to HTTP/3
Step-by-step guide for enabling HTTP/3 alongside HTTP/2. Covers QUIC setup, firewall configuration, Alt-Svc headers, DNS records, and monitoring.
Detailed Explanation
Migrating from HTTP/2 to HTTP/3
Adding HTTP/3 support alongside your existing HTTP/2 setup is straightforward with most CDNs and modern servers. The key difference is infrastructure: QUIC uses UDP instead of TCP.
Step 1: Verify UDP Port 443
QUIC uses UDP port 443. Ensure your infrastructure allows UDP traffic:
# Check if UDP 443 is open
sudo ufw allow 443/udp
# Or with iptables
sudo iptables -A INPUT -p udp --dport 443 -j ACCEPT
Many enterprise firewalls block UDP by default. Coordinate with your network team.
Step 2: Enable QUIC on Your Server
Using a CDN (easiest):
- Cloudflare: Enabled by default
- AWS CloudFront: Enable in distribution settings
- Google Cloud CDN: Enable in load balancer config
Caddy:
example.com {
# HTTP/3 is enabled by default in Caddy 2.6+
}
Nginx (experimental):
server {
listen 443 ssl http2;
listen 443 quic reuseport;
http3 on;
add_header Alt-Svc 'h3=":443"; ma=86400';
}
Step 3: Advertise HTTP/3 Support
Browsers discover HTTP/3 via two mechanisms:
Alt-Svc header (primary):
Alt-Svc: h3=":443"; ma=86400
HTTPS DNS record (faster discovery):
example.com. 300 IN HTTPS 1 . alpn="h3,h2"
Step 4: Test
- Chrome DevTools > Network > Protocol column shows "h3"
- Firefox:
about:networking#dnsshows HTTPS record - curl:
curl --http3 https://example.com - Online: HTTP/3 Check
Step 5: Monitor
Track the percentage of requests using each protocol:
- h3 (HTTP/3)
- h2 (HTTP/2)
- http/1.1
Monitor for fallback rates — if QUIC is blocked, users automatically fall back to HTTP/2. High fallback rates may indicate firewall or middlebox issues.
Key Difference from HTTP/2 Migration
Unlike HTTP/1.1 to HTTP/2, the HTTP/2 to HTTP/3 migration requires no application changes. All optimizations for HTTP/2 (multiplexing-friendly asset strategy, removing domain sharding) also benefit HTTP/3.
Use Case
Operations teams already running HTTP/2 should add HTTP/3 support, especially if they serve mobile-heavy traffic. The migration is additive (HTTP/2 remains as fallback) and low-risk. The main infrastructure change is ensuring UDP 443 is open through all firewalls and load balancers.