SSL, multiple server blocks, same domain?

Igor Sysoev igor at sysoev.ru
Fri Dec 11 18:06:27 MSK 2009


On Fri, Dec 11, 2009 at 03:03:41PM +0000, Phillip Oldham wrote:

> If one has a wildcard SSL certificate (*.mydomain.org), is it possible 
> to use that with many `server` blocks on the same server?
> 
> For instance, if one has both a `www.` (http) and `secure.` (https) and 
> wants to serve images from a subdomain for both servers, is this possible:
> 
> server {
>     server_name www.mydomain.org;
>     listen 80;
> }
> 
> server {
>     server_name secure.mydomain.org;
>     listen 443;
>     ssl on;
>     ssl_certificate /etc/ssl/mydomain.pem;
>     ssl_certificate_key /etc/ssl/mydomain.key;
> }
> 
> server {
>     server_name images.mydomain.org;
>     listen 80;
>     listen 443;
>     ssl on;

-     listen 443;
-     ssl on;
+     listen 443  ssl;

>     ssl_certificate /etc/ssl/mydomain.pem;
>     ssl_certificate_key /etc/ssl/mydomain.key;
> }

Yes:

http://nginx.org/en/docs/http/configuring_https_servers.html#certificate_with_several_names
http://nginx.org/en/docs/http/configuring_https_servers.html#single_http_https_server


-- 
Igor Sysoev
http://sysoev.ru/en/



More information about the nginx mailing list