You’re probably looking for On-Demand TLS. Automatic HTTPS — Caddy Documentation
Are you sure you need different config per customer domain? Can’t you just do that mapping in your PHP app itself? You can look at $_SERVER['HTTP_HOST']
to see the domain requested and then do setenv()
or whatever based on that (via a DB lookup or from a config file).