1. Caddy version (caddy version
):
v2.4.0-beta.1
2. How I run Caddy:
docker
a. System environment:
Fedora 33
Docker
b. Command:
paste command here
c. Service/unit/compose file:
paste full file contents here
d. My complete Caddyfile or JSON config:
{
email email@example.com
#acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
}
(dnsauth) {
tls {
dns cloudflare {env.CLOUDFLARE_API_TOKEN}
}
log {
output file /var/log/caddy/access.log
}
}
*.{$MY_DOMAIN}:443 {
import dnsauth
@cloud {
host cloud.{$MY_DOMAIN}
}
reverse_proxy @cloud nextcloud-app:80 {
header Strict-Transport-Security max-age=31536000;
redir /.well-known/carddav /remote.php/carddav 301
redir /.well-known/caldav /remote.php/caldav 301
}
@whoami {
host whoami.{$MY_DOMAIN}
}
reverse_proxy @whoami whoami:80
}
3. The problem I’m having:
I’m trying to use wildcard certs for multiple subdomains and not sure if im doing it correctly, for testing I included Nextcloud and whoami but I’ll like to add more later. I think im getting the cert correctly but the additional options for Nextcloud aren’t working when I add them, can I add headers and redir under reverse proxy?
4. Error messages and/or full log output:
caddy | run: adapting config using caddyfile: parsing caddyfile tokens for ‘reverse_proxy’: /etc/caddy/Caddyfile:22 - Error during parsing: unrecognized subdirective header