Multi domain single Caddy Server

Hi all,

I just compiled my first caddy server from source and I’m loving it. I have an ssl question that I wasn’t able to resolve searching this forum.

Caddyfile:

Domain1.com, domain2.dev {
tls email@adress
}

Domain.com uses the default email ssl
Domain.dev has a digicert ssl

Can I add the digicert to the.dev domain? If there is an example I could learn from this is a total newb question.

Thanks in advance

1 Like

Hi @Crook, welcome to the Caddy community!

The tls directive applies to the entire site, so you’d have to open a separate site definition.

example.com {
  tls email@example.com
}

example.net {
  tls [cert] [key]
}

If you’ve got additional configuration you want to share between the two, you could either copy+paste it between them, or use snippets:

https://caddyserver.com/docs/tls

2 Likes

@Whitestrake thanks for mentioning snippets, very useful feature !

1 Like

Thanks @Whitestrake I appreciate the support and welcoming!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.