1. The problem I’m having:
I have multiple configs for each app (subdomain). My goal is not touching the config file for multiple domains. I want to define the different domain names via an environment variable.
At the moment i define my apps for a domain like this. So i can specify the domain name via environment var.
app1.{$BASE_DOMAIN} {
...
}
This is working fine, but i have several host that have multiple (alternative) domain-names that should serve the same apps.
app1.domain-a.com, app1.domain-a.com {
...
}
app2.domain-a.com, app2.domain-b.com {
...
}
so it would be nice to have something like this possible.
app1.{$DOMAINS} {
...
}
app2.{$DOMAINS} {
...
}
where environment var $DOMAINS can be for example “localhost | domain-a | domain-b”
Is it possible to use dynamic (environment-based) base-domain-names, so that i did not need to touch the caddy-config for multiple domains?
Thank you for any hint on this.
Tobias