Welcome! Log In Create A New Profile

Advanced

Question :disable port 443 for non listed virtual hosts.

Posted by icnseo 
Question :disable port 443 for non listed virtual hosts.
May 19, 2013 05:24AM
Hello there.
I use nginx 1.4.1 from 1-2 weeks and i'm realy happy with it. I have the following question.
I have configured 4 virtual hosts (servers).

First is default_server which is for all non-configured domains (sub-domains) that are configured with my DNS server (A records).
Second one is my main website with ports 80 and 443. other two are one with both ports ssl and non-ssl and last one is only port 80.
My question is : how i can disable port 443 for virtual hosts that use only port 80. by the now if i type it's domain with https:// it redirects me to my main site and i want to stop that somehow.

So is it possible to be done.

Kind regards.
Re: Question :disable port 443 for non listed virtual hosts.
May 19, 2013 02:37PM
Found a solution.
Added

if ($host != $server_name) {
return 444;
}

now every host that is configured/non-configured will be returned to 444 if there is no setup for SSL.
Re: Question :disable port 443 for non listed virtual hosts.
May 21, 2013 05:44AM
Be aware that the server will disclose the identity of a hosted site to any non-SNI compliant browsers via the certificate, because of the way that the SSL negotiation works (see wikipedia: http://en.wikipedia.org/wiki/Server_Name_Indication). Hence it's a good idea to generate a generic certificate for such cases.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 202
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