1. The problem I’m having:
I need a proxy that forwards every https request from two domains (s1.mydomain.de
and s2.mydomain.de
) to two separate caddy server. Each Caddy server must handle CERT generation and subdomains.
I don’t know how to configure that.
Example:
caddy-server-1 should handle *.s1.mydomain.de
caddy-server-2 should handle *.s2.mydomain.de
Caddyfile on caddy-server-1:
{
email my.email@gmail.com
acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
}
# -- NOT WORKING --
#s2.mydomain.de {
# reverse_proxy /* https://192.168.178.251
#}
traccar.s1.mydomain.de {
reverse_proxy http://traccar:8082
}
nextcloud.s1.mydomain.de {
reverse_proxy http://nextcloud:8083
}
Caddyfile on caddy-server-2:
{
email my.email@gmail.com
acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
}
test.s2.mydomain.de {
reverse_proxy http://test-docker-container:8001
}
Everything on s1.mydomain.de is working well. Thanks to caddy!
External DNS configuration for all subdomains are also fine:
s1.mydomain.de
, *.s1.mydomain.de
, s2.mydomain.de
, *.s2.mydomain.de
are pointing to the correct target server.
Requirements:
- caddy-server-2 musst generate certificates for each subdomain (e.g.
test.s2.mydomain.de
)
4. How I installed and ran Caddy:
Everything is dockerized.
Thanks!