Wildcard Selfhosting

The v2 Caddyfile doesn’t have a tls dns equivalent yet, but it’s configurable in JSON. I can’t find a wildcard-equivalent in JSON either though right now, so example 2 is the way to go.

You could start with this:

*.example.com {
  @bitwarden {
    host bitwarden.example.com
  }
  reverse_proxy @bitwarden 192.168.10.50:8088

  @nextcloud {
    host nextcloud.example.com
  }
  reverse_proxy @nextcloud 192.168.10.50:8080
}

Then run caddy adapt --pretty --validate in the same directory as that Caddyfile to get the JSON equivalent. From there, add your DNS provider to the challenges area of the acme JSON configuration.