Select SSL Certificate based on the requested host since the limit on certificate exceeded


We have created a certificate with multiple domains and we saw that each file could have just 100 domains added. So which means, we have to generate one more certificate for the next domains. So if we can generate another file for the new domains, how can the new certificate be used. If the domain does not fall in the first certificate, how should we configure such that it takes the next certificate and get the SSL loaded in nginx.


Hi @logeshmallow

same as every certificate. One vHost can use one certificate. So you need a new vHost.

What’s your current configuration?

One vHost with more then 100 domains?


I am not clear with the point that one vHost can use only one certificate. We need to have a common cname record. So, how can I configure the DNS such that one request goes to a specific vhost and other request to the next vhost.

We are allowing user to have custom domains and point to a cname and so there could be n number of domains and we need to have ssl for those and that should serve from same host. Is there a way to do that?


Yes. You just have to write a second server block in Nginx.

(It will probably basically be a duplicate of the first one, with different SSL and server_name settings.)

(Using the include directive can make this easier.)


Ok, I will try adding another server block with different SSL and server_name settings. Should the server_name also needs to be different?


Yes, using the same server_name in more than one block is only ok if they are listening on different ports (i.e. one for http and another for https).