Multiple SSL vhosts using wildcard certificate in nginx

Posted by vvanscherpenseel on Server Fault See other posts from Server Fault or by vvanscherpenseel
Published on 2013-10-27T11:36:10Z Indexed on 2013/10/27 15:54 UTC
Read the original article Hit count: 229

Filed under:
|
|
|
|

I have two hostnames sharing the same domain name which I want to serve over HTTPs. I've got a wildcard-SSL certificate and created two vhost configs:

Host A

listen      127.0.0.1:443 ssl;
server_name     a.example.com;
root        /data/httpd/a.example.com;
ssl_certificate /etc/ssl/wildcard.cer;
ssl_certificate_key /etc/ssl/wildcard.key;

Host B

listen      127.0.0.1:443 ssl;
server_name     b.example.com;
root        /data/httpd/b.example.com;
ssl_certificate /etc/ssl/wildcard.cer;
ssl_certificate_key /etc/ssl/wildcard.key;

However, I get the same vhost served for either hostname.

© Server Fault or respective owner

Related posts about nginx

Related posts about ssl