Hello,
1. The problem I’m having:
I’m trying to create a CaddyFile which allows me to authorize any domain, as long as I have a directory with its name in my folder, and to use this directory as root
For example: if the domain example.com has its DNS A pointing to my server, and someone visits example.com, I want to
- Check if I have a directory /home/codi/clients/example.com/
- If yes, issue the SSL certificate and launch the index.html inside
It’s my first time with Caddy and I start with a complex scenario … my Caddyfile could be really bad, I’m sorry if my question it not good
2. Error messages and/or full log output:
When I try with a test domain, nothing happens and I don’t see any log in my “caddy run”
3. Caddy version:
v2.6.4 h1:2hwYqiRwk1tf3VruhMpLcYTg+11fCdr8S3jhNAdnPy8=
4. How I installed and ran Caddy:
Following the documentation, as a debian package
a. System environment:
Debian
b. Command:
I tried caddy start first but to see what’s happening I’m using caddy run now
d. My complete Caddy config:
{
on_demand_tls {
ask https://check.codicommerce.fr
}
}
https://check.codicommerce.fr {
root * /home/codi/clients/
@deny not file /{host}/
respond @deny 404
}
* {
tls {
on_demand
}
root /var/www/clients/{host}
file_server
}
5. Links to relevant resources:
I took inspiration for my CaddyFile on these links:
Thx!