I am very new to Caddy. How to create multiple SSL certificates using REST API ? What we are planning to do is to use Caddy as a load balancer to serve hundred of domains via https, and reverse proxy requests to nginx server.
So basically I’m trying to figure out if i can automate issuing SSL certificates for domains using RESTful API with Caddy.
Thanks for your reply, for the first option, yes, we control the domains, we control the DNS of our domains, we will be pointing them to the server at which Caddy is running and we will use Caddy to manage certificates for domains as well.
How can we add a domain to Caddy config and setup its certificate using rest API call ?
I’ve checked API — Caddy Documentation, but could not find an example about creating the certificate and adding a domain.
It’s a config API, so use the endpoint you prefer to modify your configuration to add the domain to it, next to all the other ones. Probably a POST request to a host matcher.
My recommendation if you’re new to it: start with a simple Caddyfile with one or two domains (use Let’s Encrypt’s staging endpoint or even internal TLS certs to test), then adapt it to JSON and then it will become pretty clear/obvious where to put the domains