https://www.reddit.com/r/selfhosted/comments/gdftii/caddy_2_the_reverse_proxywebserver_with_automatic/
Example
book.{$MY_DOMAIN} {
reverse_proxy bookstack:80
}
grafana.{$MY_DOMAIN} {
reverse_proxy grafana:3000
}
:9090 {
reverse_proxy prometheus:9090
}
Basic Auth
caddy hash-password <yourpassword>
url {
basicauth {
<username> <hashedpassword>
}
reverse_proxy <hostname:port>
}