1. Output of caddy version
:
v2.5.2 h1:eCJdLyEyAGzuQTa5Mh3gETnYWDClo1LjtQm2q9RNZrs=
2. How I run Caddy:
systemd
a. System environment:
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy
systemd 249 (249.11-0ubuntu3.4)
+PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP -LIBFDISK +PCRE2 -PWQUALITY -P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified
b. Command:
systemd
c. Service/unit/compose file:
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target
[Service]
Type=notify
User=caddy
Group=caddy
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile --force
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
d. My complete Caddy config:
Caddyfile:
import /etc/caddy/snippets/global.conf
import /etc/caddy/sites/*.conf
snippets/global.conf
(encoding) {
encode zstd gzip
}
sites/example.conf
example.com {
root * /var/www/example.com/httpdocs
# IMPORT DEFAULTS
import encoding
# ...
}
3. The problem I’m having:
Caddy uses always gzip instead of zstd, no matter what I try. My network analysis shows content-encoding: gzip. Is there a possibility that I need to install zstd on the OS? E.g. apt install zstd (if yes, then this should be mentioned in the caddy docs) or is zstd directly integrated in the compiled caddy application? There seems to be no additional output / logs to warn the user about this behavior.
4. Error messages and/or full log output:
No errors.
5. What I already tried:
I’ve placed “encode zlib gzip” directly in the sites configuration. But there is no difference, caddy always uses gzip no matter what I do or try.