Skip to content

Instantly share code, notes, and snippets.

@gilbitron
Created March 14, 2022 17:23
Show Gist options
  • Save gilbitron/1e067d6247a8a8cb2a439a30c4087329 to your computer and use it in GitHub Desktop.
Save gilbitron/1e067d6247a8a8cb2a439a30c4087329 to your computer and use it in GitHub Desktop.
Caddy wildcard + custom domains
{
on_demand_tls {
ask http://12.34.56.78/caddy-check
}
email hi@example.com
}
*.example.com {
tls ...custom certs...
reverse_proxy http://12.34.56.78
}
:80 {
redir https://{host}{uri}
}
:443 {
tls {
on_demand
issuer zerossl ...
issuer acme
}
reverse_proxy http://12.34.56.78 {
header_up Host {host}
header_up X-Forwarded-Port {server_port}
header_up X-Forwarded-For {remote}
header_up X-Forwarded-Proto {scheme}
health_timeout 5s
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment