QUIC - HTTP/3 on Nginx
How to enable HTTP/3 on an Nginx server
Nginx 1.25 introduced functional QUIC support, and experimental HTTP/3 support. Caddy’s had QUIC support for some time; LiteSpeed is promoting it; Docker-hosted Wiki.JS (what this site runs on) does not, as of July 2024. This quick guide assumes you were already using HTTPS on your website before; if not, you should look up Let’s Encrypt and an SSL config generator.
- Adjust your firewall rules on your cloud provider, firewall appliance, and/or iptables / nftables / ufw rules in Linux: you will need to open UDP 443.
- Update to at least Nginx 1.25, using the Nginx distribution repos.
- Official Nginx uses
/etc/nginx/conf.d/to look up.conffiles for site definitions. If you were using non-conf files in/etc/nginx/sites-available&/etc/nginx/sites-enabled, move those over as.conffiles and/or update/etc/nginx/nginx.confto use thesites-enableddirectory (the symlinks tosites-availablecan be moved themselves to.conffilenames). - Edit your site
.conffiles to use the following for HTTPS:listen 443 quic; listen 443 ssl; http2 on; - For each
.conffile, add the following to eachlocationsection:add_header Alt-Svc 'h3=":443"; ma=86400'; - If using php-fpm applications, you might need to set your pools to the
nginxuser (though some recommend a different way to handle this). - Restart Nginx and run an HTTP/3 Check against your website.
Read other posts