if statement + ssl_certificate?

Jonathan Matthews contact at jpluscplusm.com
Sat Jun 1 20:55:35 UTC 2013


On 1 June 2013 18:32, natostanco <nginx-forum at nginx.us> wrote:
> I guess either I can't
> declare a server with server_name equal to a subdomain of an already
> declared TLD.

That's not the case. Nginx can do this just fine.

You're coming up against the age-old SSL virtual hosting problem,
which is caused by the server's SSL certificate having to be presented
to the client before the Host header is known. This is a problem for
all HTTP servers, and is the reason why (for most cases) you need
multiple IPs when hosting multiple sites over HTTPS. There are
exceptions to this, and your situation happens to be one of these.
Google "wildcard SSL certificate" to discover the sort of cert you'd
have to buy to take advantage of this.

"SNI" is the long-term fix for this, but as client support for it is
not yet near ubiquitous, it's probably not applicable to your
situation. If you absolutely control all the clients, it can be an
option.

HTH,
Jonathan



More information about the nginx mailing list