1. Caddy version (caddy version
):
v2.5.1
2. How I run Caddy:
Caddy in Docker
a. System environment:
Mac OS 12.4 with Docker Desktop 4.9.0, Docker Engine 20.10.16, Compose 1.29.2
b. Command:
docker-compose up -d
c. Service/unit/compose file:
version: "2.2"
services:
caddy:
container_name: 'caddy-cluster-proxy'
image: 'caddy:2.5.1-alpine'
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- caddy_data:/data
- ./:/etc/caddy/
command: caddy run --config /etc/caddy/*Caddyfile --watch
volumes:
# Cached caddy data, e.g. certs
caddy_data:
d. My complete Caddyfile or JSON config:
Caddyfile:
:80 {
respond "Hello, world!"
}
https.Caddyfile:
:443 {
"Hello world, HTTPS!"
}
3. The problem I’m having:
I want to configure Caddy to pick up all the Caddyfiles in a directory, and read config from all of them. I understand I can do this with imports but for flexibilities sake I’d like to do it without.
4. Error messages and/or full log output:
run: reading config file: open /etc/caddy/*Caddyfile: no such file or directory
5. What I already tried:
I read Organizing Sites into multiple Caddyfiles - #3 which indicates I can do this with -conf '/path/to/*.caddy'
. This didn’t work; perhaps these instructions are for Caddy 1? I tried --config /etc/caddy/*Caddyfile
but got the “no such file or directory” error above.
Is it possible, in Caddy 2, to load multiple Caddyfiles without using imports?