Update example nginx configs to require Host match.

This commit is contained in:
Carl Meyer 2015-06-15 16:59:34 -06:00
parent 5a8b9555da
commit 2169b044d6
2 changed files with 22 additions and 6 deletions

View File

@ -39,9 +39,17 @@ An `example configuration`_ file for fast clients with Nginx_::
}
server {
listen 80 default;
# If no Host match, close the connection to prevent Host spoofing
listen 80 default_server;
return 444;
}
server {
listen 80;
client_max_body_size 4G;
server_name _;
# set the correct host(s) for your site
server_name example.com www.example.com;
keepalive_timeout 5;

View File

@ -70,12 +70,20 @@ http {
}
server {
# listen 80 default deferred; # for Linux
# listen 80 default accept_filter=httpready; # for FreeBSD
listen 80 default;
# If no Host match, close the connection to prevent Host spoofing
listen 80 default_server;
return 444;
}
server {
# listen 80 deferred; # for Linux
# listen 80 accept_filter=httpready; # for FreeBSD
listen 80;
# set the correct host(s) for your site
server_name example.com www.example.com;
client_max_body_size 4G;
server_name _;
# ~2 seconds is often enough for most folks to parse HTML/CSS and
# retrieve needed images/icons/frames, connections are cheap in