I.e. an example of this:
-> curl -kI -H "Host: valid.com" https://localhost
HTTP/1.1 200 OK
...
-> curl -kI -H "Host: invalid.com" https://localhost
curl: (52) Empty reply from server
Whether this works or not depends on SNI.
To include the SSL related directives in the port 80 server block seems to be redundant.
Because we are redirecting explicit all incoming traffic via port 80 to the HTTPS host on
port 443 where only the *secure-connection-magic* is happen.
Maybe I am missing something, but I tested the configuration
under the following system and encountered no negative side effects:
**Server**
* Ubuntu 14.04 LTS
* Nginx 1.7.7 mainline
**Client**
* OS X 10.9.5
* Browser: FF 33, Chrome 38, Safari 7
Make it more obvious which snippets are location based, and which
are just directives. Need to provide more files like basic.conf to
cover more of the common use cases.
and remove the default_server direcdtive from example.com. Since this file
is likely to be the copy-and-paste file for multiple server configs,
don't mark example.com as the default.