Welcome! Log In Create A New Profile

Advanced

Re: Issue with VirtualHost definition order and SNI SSL

October 09, 2009 03:18PM
On Fri, Oct 09, 2009 at 11:22:29AM -0700, Linmiao Xu wrote:

> When running SSL on more than one virtual host (one IP), I get a weird issue
> when virtual hosts are defined in different orders. One virtual host is a
> TLD (example.com), and one is an alias I set in /etc/hosts (alias). Both use
> their own certificates and work fine when I define them in this order:
>
> include /etc/nginx/vhosts/ssl_example.com.conf;
> include /etc/nginx/vhosts/ssl_alias.conf;
>
> But when I reverse the order, both hosts try to use (alias)'s certificate,
> so I get an ssl warning when trying to connect to (example.com).
>
> In both cases, I use "listen 443" and server_name is set as (example.com)
> and (alias). I don't listen on 443 except in virtual hosts, all with
> server_name defined. When I use "listen 443 default ssl" instead of "listen
> 443" for (example.com), this problem goes away. It looks like nginx takes
> the first virtual host that listens on 443 if I try to connect to the server
> on a host that isn't listening on 443.

Yes, nginx uses the first server for a given listen pair if no explicit
default server is defined for the listen pair.

> But I still don't understand.. both of the above are valid hosts, so why
> does the order in which I include the virtual hosts cause different results?

Are you sure that nginx was built with SNI support ?
What browsers and nginx versions do you use ?


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

Issue with VirtualHost definition order and SNI SSL

Linmiao Xu October 09, 2009 02:28PM

Re: Issue with VirtualHost definition order and SNI SSL

Igor Sysoev October 09, 2009 03:18PM

Re: Issue with VirtualHost definition order and SNI SSL

Linmiao Xu October 09, 2009 08:50PM

Re: Issue with VirtualHost definition order and SNI SSL

Igor Sysoev October 19, 2009 06:14AM

Re: Issue with VirtualHost definition order and SNI SSL

ianchov October 22, 2009 09:30AM

Re: Issue with VirtualHost definition order and SNI SSL

Igor Sysoev October 27, 2009 01:54AM

Re: Issue with VirtualHost definition order and SNI SSL

ianchov October 27, 2009 02:26AM

Re: Issue with VirtualHost definition order and SNI SSL

Igor Sysoev October 27, 2009 03:28AM

Re: Issue with VirtualHost definition order and SNI SSL

Iantcho Vassilev October 27, 2009 07:00AM

Re: Issue with VirtualHost definition order and SNI SSL

Igor Sysoev October 27, 2009 12:30PM

Re: Issue with VirtualHost definition order and SNI SSL

Iantcho Vassilev October 27, 2009 01:50PM

Re: Issue with VirtualHost definition order and SNI SSL

Igor Sysoev October 27, 2009 03:48PM

Re: Issue with VirtualHost definition order and SNI SSL

Iantcho Vassilev October 28, 2009 03:36AM

Re: Issue with VirtualHost definition order and SNI SSL

Igor Sysoev October 28, 2009 04:30AM

Re: Issue with VirtualHost definition order and SNI SSL

Iantcho Vassilev October 28, 2009 06:10PM

Re: Issue with VirtualHost definition order and SNI SSL

Igor Sysoev October 29, 2009 03:02AM

Re: Issue with VirtualHost definition order and SNI SSL

Iantcho Vassilev October 29, 2009 03:40AM

Re: Issue with VirtualHost definition order and SNI SSL

Igor Sysoev October 29, 2009 04:14AM

Re: Issue with VirtualHost definition order and SNI SSL

Iantcho Vassilev October 29, 2009 04:38AM

Re: Issue with VirtualHost definition order and SNI SSL

Igor Sysoev October 29, 2009 04:48AM

Re: Issue with VirtualHost definition order and SNI SSL

ianchov October 27, 2009 02:30AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 61
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready