1. My Caddy version (caddy -version
):
v2.0.0-beta11
2. How I run Caddy:
{
"apps": {
"tls": {
"automation": {
"policies": [{
"management": {
"module": "acme",
"ca": "https://acme-staging-v02.api.letsencrypt.org/directory",
"on_demand": true
}
}],
"on_demand": {
"rate_limit": {
"interval": "10m",
"burst": 2
}
}
}
},
"http": {
"servers": {
"myserver": {
"listen": [":443"],
"routes": [
{
"handle": [
{
"handler": "file_server",
"root": "/home/www"
}
]
}
]
}
}
}
}
}
a. System environment:
Linux (x86 64)
3. The problem I’m having:
I am trying to create a V2 config which will automatically setup TLS when a newly setup host is accessed after DNS setup.
The equivalent in V1 works fine:
http://, https:// {
root /home/www
browse
tls {
max_certs 10
}
}
So I am really looking for a V2 equivalent of the above config.
4. Error messages and/or full log output:
I have pointed a couple of sites to the server: s1.example1.com, s2.example2.com but I receive no response with the above V2 config. It works file with the V1 config.
For V2, it works if I add the following in routes:
"match": [{"host": [
"s1.example1.com",
"s2.example2.com"
]}]
So unless I add the specific hosts, the automatic TLS setup does not work.
5. What I already tried:
- Use adapt on the V1 working config but get an error:
adapt: parsing caddyfile tokens for 'root': Caddyfile:2 - Error during parsing: Wrong argument count or unexpected line ending after '/home/www'
- Instead of rate limiting, used “ask” but the target server does not receive any request for confirming TLS setup.
I am new to Caddy and would appreciate any guidance on this.