Multiple IP addresses + domains + SSL certificates for one website

I would like to have two domains, each with its own SSL certificate, each SSL certificate has its own IP, of course, to point to the same website on the same physical server. Of course, the server must have two IP addresses. How does is called? How is this done with nginx? OS is Linux. Thank you

+6
source share
1 answer

Create two server entries with different listen and ssl_certificate(_key) directives using different IP addresses but the same root where your shared web pages are stored. For instance:

 server { listen 1.2.3.4:443; server_name first-domain.example; root /srv/html/shared_domain_data; ssl on; ssl_certificate /etc/nginx/ssl/first_domain.pem; ssl_certificate_key /etc/nginx/ssl/first_domain_key.pem; } server { listen 9.8.7.6:443; server_name second-domain.example; root /srv/html/shared_domain_data; ssl on; ssl_certificate /etc/nginx/ssl/second_domain.pem; ssl_certificate_key /etc/nginx/ssl/second_domain_key.pem; } 

He did not say anything special.

+11
source

Source: https://habr.com/ru/post/911235/


All Articles