How to Enable HTTP/3 (QUIC) on Nginx in 2026

What HTTP/3 on Nginx Requires

HTTP/3 on Nginx is worth enabling when your visitors use modern browsers and your server already runs over TLS. HTTP/3 moves web traffic from TCP to UDP through the QUIC protocol, which can cut connection setup time on lossy mobile networks and recover faster when a connection stalls. Before you change anything, check that your Nginx build actually includes QUIC support, because a stock package from an older repository may not. This guide shows how to enable HTTP/3 on Nginx on Ubuntu 24.04, test it properly, and keep HTTP/2 as a fallback for older clients.

The QUIC protocol is the transport layer underneath HTTP/3. Unlike HTTP/2, which runs over TCP, HTTP/3 over UDP avoids head-of-line blocking at the transport level, so one lost packet does not hold up every stream on the connection. That matters most for visitors on mobile networks, where packet loss is common. Nginx HTTP/3 support arrived in mainline Nginx 1.25 and later, and it needs OpenSSL 3.0 or newer with QUIC support compiled in. If you run an older Nginx, upgrade first rather than trying to patch QUIC support onto it.

You also need a valid TLS certificate. HTTP/3 only works over encrypted connections, so a plain HTTP site cannot use it. If you have not set up certificates yet, follow a guide for installing a free Let’s Encrypt certificate on Nginx before continuing. Your firewall must allow UDP traffic on port 443 in addition to TCP, or browsers will never reach the QUIC listener and will silently fall back to HTTP/2.

Check Your Nginx Build for QUIC Support

Run the version command and look for the QUIC flag in the build output:

nginx -V 2>&1 | tr ' ' 'n' | grep -i quic
sudo nginx -t

If the grep output shows nothing, your build lacks QUIC and you need a newer Nginx package. The official Nginx repository ships builds with QUIC enabled for recent releases. Do not compile from source unless you have a reason to, because keeping a hand-built Nginx updated is extra work every time a security release lands. Once nginx -t reports success, you know the current configuration is valid, which gives you a safe baseline before editing.

It helps to know where your server blocks live before editing. Most Ubuntu setups keep them in /etc/nginx/sites-available/ with symlinks in sites-enabled/. If you are unsure, the walkthrough for setting up Nginx server blocks on Ubuntu 24.04 explains the layout. Edit the server block for the domain you want to upgrade, not the default block, so a mistake affects one site instead of all of them.

Enable HTTP/3 on Nginx in a Server Block

Open your site configuration and add a QUIC listener alongside the existing TLS listener. The reuseport option lets Nginx handle UDP efficiently, and the Alt-Svc header tells browsers that HTTP/3 is available on this host:

server {
    listen 443 ssl;
    listen 443 quic reuseport;
    http2 on;
    server_name example.com;

    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;

    add_header Alt-Svc 'h3=":443"; ma=86400' always;

    root /var/www/example.com;
    index index.html;
}

Keep the TCP listener. Browsers that do not support HTTP/3 will use HTTP/2, and the Alt-Svc header is how a browser learns to try HTTP/3 on its next visit. The first visit still happens over TCP, because the browser has no way to know HTTP/3 exists until it sees that header. This is normal behaviour, not a configuration error.

Next, open UDP port 443 in your firewall. With UFW the command is:

sudo ufw allow 443/udp
sudo ufw status

Then test the configuration and reload Nginx:

sudo nginx -t
sudo systemctl reload nginx

If nginx -t fails, read the error line carefully. The most common mistake is adding the QUIC listener to a build that lacks QUIC support, which produces an “invalid parameter” error for the listen directive. The second most common mistake is a missing certificate file path. Fix the reported line, test again, and only then reload.

Test HTTP/3 and Confirm It Works

Testing matters because a silent fallback to HTTP/2 looks identical to a working site. Start with curl if your version supports HTTP/3:

curl --http3 -I https://example.com
curl -I https://example.com

If curl on your system lacks HTTP/3 support, use a browser instead. In Chrome or Firefox, open developer tools, go to the Network tab, reload the page, and check the Protocol column. An h3 entry means HTTP/3 is working. You may need to visit the site twice, since the browser only learns about HTTP/3 from the Alt-Svc header on the first visit. Clear the browser cache if you changed the header and the protocol column still shows h2.

Also check the TLS side of the setup. HTTP/3 requires TLS 1.3, and an old TLS configuration can block the handshake. A review of TLS 1.2 versus TLS 1.3 for your server explains which protocols to keep enabled. If you run a reverse proxy in front of other services, remember that HTTP/3 terminates at Nginx; the upstream connection still uses HTTP/1.1 or HTTP/2, and that is fine.

Fix Common HTTP/3 Problems

When HTTP/3 does not appear in testing, work through the likely causes in order. First, confirm the firewall really allows UDP 443. Many cloud providers have a separate security group or firewall outside the server, and opening UFW alone does not open that layer. Second, check that the Alt-Svc header is actually sent by running curl -I https://example.com and looking for it in the response headers. If the header is missing, you edited the wrong server block or forgot to reload.

Third, verify the browser is not forcing an older protocol through an extension or a corporate proxy. Test from a different network or a clean browser profile to rule that out. Fourth, check Nginx error logs for QUIC errors:

sudo tail -n 50 /var/log/nginx/error.log

Finally, remember that some networks block UDP entirely. That is not a problem you need to fix on the server, because those visitors fall back to HTTP/2 automatically. HTTP/3 is an improvement for the visitors who can use it, not a requirement for everyone.

When to Keep HTTP/2 as a Fallback

Keep HTTP/2 enabled permanently. HTTP/3 adoption is strong in current browsers, but older browsers, bots, and monitoring tools still speak HTTP/2, and removing it would break them for no benefit. The right setup is both protocols side by side, with HTTP/3 preferred when the client supports it. If you compare server software before committing to this setup, the comparison of Nginx, Apache, and Caddy for a low-RAM VPS is a useful reference, since HTTP/3 support differs across servers. Once HTTP/3 is live, recheck it after every Nginx upgrade, because a package change can replace a QUIC-enabled build with one that lacks it.

Ditulis oleh

Firdaus Safari Putra

Founder, PT FirKaizen Digital Solutions

Firdaus Safari Putra adalah founder PT FirKaizen Digital Solutions. Ia membangun dan mengoperasikan infrastruktur server di balik panduan ini, dan menulis berdasarkan apa yang benar-benar ia jalankan, uji, dan ukur — bukan teori.