From 3921535db8b9123432fe11a18842989c48fe7b07 Mon Sep 17 00:00:00 2001 From: AD7six Date: Wed, 20 Nov 2013 20:40:02 +0000 Subject: [PATCH] add a doc block to no-default 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. --- sites-available/example.com | 6 +++--- sites-available/no-default | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sites-available/example.com b/sites-available/example.com index bc56697..0ae72f2 100644 --- a/sites-available/example.com +++ b/sites-available/example.com @@ -14,9 +14,9 @@ server { } server { - # listen 80 default_server deferred; # for Linux - # listen 80 default_server accept_filter=httpready; # for FreeBSD - listen 80 default_server; + # listen 80 deferred; # for Linux + # listen 80 accept_filter=httpready; # for FreeBSD + listen 80; # The host name to respond to server_name example.com; diff --git a/sites-available/no-default b/sites-available/no-default index 9b8f8ab..908b468 100644 --- a/sites-available/no-default +++ b/sites-available/no-default @@ -1,3 +1,10 @@ +# Drop requests for unknown hosts +# +# If no default server is defined, nginx will use the first found server. +# To prevent host header attacks, or other potential problems when an unknown +# servername is used in a request, it's recommended to drop the request +# returning 444 "no response". + server { listen 80 default_server; return 444;