Multiple certificates in one server block?

B.R. reallfqq-nginx at
Mon Aug 7 17:34:12 UTC 2017

Jim already replied with his ECDSA+RSA example in a single server block.
You can also serve several names from a single server block.

However, I never tested serving a certificate for several domains all
served by the same virtual server block. I *suppose* nginx might be clever
enough to select the right certificate(s) to serve. ANyone to test that?
Anyway, for that to work, you will need to ensure both ends support SNI
with their TLS library.
First impressions, though: it does not look as an ideal setup to me, as it
most probably will end up in a spaghetti configuration nightmare. It
depends, as always. A long (potentially repetitive), clear (as in 'server
block-complete'), nginx configuration properly managed through
configuration management tools will always appeal the most to me for
debugging purposes.
*B. R.*

On Fri, Aug 4, 2017 at 3:47 PM, Olaf van der Spek <
nginx-forum at> wrote:

> Jim Ohlstein Wrote:
> > Letsencrypt allows multiple domain names in the same certificate.
> I know, just wondering if nginx supported multiple certs per server.
> My problem:
> I've got multiple servers and I'd like the servers to be accessible via the
> common name ( and via their dedicated name (,,
> etc).
> How do I do this with letsencrypt?
> If I use certbot the verification request might / will be server by another
> host and will thus fail.
> Posted at Nginx Forum:
> php?2,275855,275860#msg-275860
> _______________________________________________
> nginx mailing list
> nginx at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list