Separate On-Demand ask endpoints

Hello,

is it possible to add different ask endpoints for each Server?

Like:


*.*.server1.com {
        tls {
                on_demand {
                        ask http://localhost:3040/api/ask-domain-a
                }
        }
...
}


*.*.server2.com {
        tls {
                on_demand {
                        ask http://localhost:2040/api/ask-domain-b
                }
        }
...
}

No, it’s not possible right now, because on_demand config is global.

In the next release, it’ll possible to use a plugin for ask so you could write your own logic instead to split it. caddytls: Make on-demand 'ask' permission modular by mholt · Pull Request #6055 · caddyserver/caddy · GitHub

That said, if you know the domains ahead of time, you should probably get a wildcard cert instead (using a DNS plugin to enable the ACME DNS challenge), and not use On-Demand TLS.