I know from the docs that HTTP/3 support in Caddy 2 is experimental and not guaranteed to work. But since Apple added support in Safari 14 on macOS Big Sur and iOS 14, I wanted to try it on my blog and could not make it work. I guess my configuration is not correct, since it’s not working in Firefox or Chrome either.
Here’s my full Caddyfile :
{
email nicolinux@gmail.com
experimental_http3
}
www.voiretmanger.fr,
blog.voiretmanger.fr,
nicolasfurno.fr,
www.nicolasfurno.fr,
blog.nicolasfurno.fr,
nicolinux.fr,
blog.nicolinux.fr,
www.nicolinux.fr,
nicoflo.fr,
www.nicoflo.fr {
redir https://voiretmanger.fr{uri}/
}
(static) {
@static {
file
path *.ico *.css *.js *.gif *.jpg *.jpeg *.png *.svg *.woff *.json
}
header @static Cache-Control max-age=5184000
}
(security) {
header {
# enable HSTS
Strict-Transport-Security max-age=31536000;
# disable clients from sniffing the media type
X-Content-Type-Options nosniff
# keep referrer data off of HTTP connections
Referrer-Policy no-referrer-when-downgrade
}
}
voiretmanger.fr {
root * /var/www/voiretmanger.fr
encode zstd gzip
file_server
import static
import security
log {
output file /var/log/caddy/voiretmanger.fr.access.log
}
# Redirect personnels
redir /a-propos/publicite /soutien
redir /archives/carte-des-restaurants /a-manger
@cache {
not header_regexp Cookie "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in"
not path_regexp "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(index)?.xml|[a-z0-9-]+-sitemap([0-9]+)?.xml)"
not method POST
not expression {query} != ''
}
route @cache {
try_files /wp-content/cache/cache-enabler/{host}{uri}/index.html {path} {path}/index.php?{query}
}
php_fastcgi unix//run/php/php7.4-fpm-caddy.sock
}
dev.voiretmanger.fr {
root * /var/www/dev.voiretmanger.fr/public
encode zstd gzip
file_server
import static
import security
log {
output file /var/log/caddy/dev.voiretmanger.fr.access.log
}
php_fastcgi unix//run/php/php7.4-fpm-caddy.sock
}
dev2.voiretmanger.fr {
root * /var/www/dev2.voiretmanger.fr
encode zstd gzip
file_server
import static
import security
log {
output file /var/log/caddy/dev2.voiretmanger.fr.access.log
}
php_fastcgi unix//run/php/php7.4-fpm-caddy.sock
}
files.voiretmanger.fr {
root * /var/www/files.voiretmanger.fr
encode zstd gzip
file_server browse
log {
output file /var/log/caddy/files.voiretmanger.fr.access.log
}
import static
import security
}
memoire.nicolasfurno.fr {
root * /var/www/memoire.nicolasfurno.fr
encode zstd gzip
file_server
log {
output file /var/log/caddy/memoire.nicolasfurno.fr.access.log
}
import static
import security
}
I’m using Caddy v2.0.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8= installed with the official Ubuntu package, on Ubuntu 20.04.
Let me know if you need logs to debug this, but as far as I can tell, there is no error inside. They just confirm I’m using only HTTP/2 protocole right now. I also tried checking on this website, and it also say it does not work.
Thanks !