6

I'm trying using nginx for having multiple ssl certificates without having to create a server for each one of them.

So I have a reverse proxy built and it will have multiple different sites with the same domain running on it. Is it possible to have the server have multiple ssl certificates and keys so that when it proxies uses the right key and cert or do I need to create its own server for every single site that gets generated?

Thanks in advance.

hal-tcp
  • 63
  • 1
  • 1
  • 3

1 Answers1

1

Yes, you can use multiple domains (each with its own SSL certificate) in nginx. You will need a separate server block for each domain in the nginx configuration file. Here's an older reference that can get you started How To Set Up Multiple SSL Certificates on One IP with Nginx on Ubuntu 12.04

If you are looking to have subdomain sites on the same IP, the same method should work as long as you match the right subdomain pattern for each server block in the nginx configuration file.

Adnan S
  • 1,852
  • 1
  • 14
  • 19
  • 3
    the request was for not having to use multiple server blocks. – ggedde Nov 24 '20 at 00:25
  • 1
    Don't see the word "blocks" in the question. The question was about servers. Did you read something that was not there? – Adnan S Nov 24 '20 at 20:45
  • 2
    I assumed that he was asking about multiple server blocks and just didn't know how to word that correctly, but you could be right in that he was asking about servers as in physical or virtual machines. – ggedde Nov 25 '20 at 12:29
  • @ggedde, I don't agree with you either. The question is about servers, not `server` blocks. The OP is refering to the problem that SNI addresses. – jg6 Mar 17 '21 at 12:39