From 03519831cbfcd3c436859dc250e346dac1f11b89 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Mon, 25 Apr 2016 21:45:21 +0300 Subject: [PATCH] roles/nginx: Return HTTP 444 for requests to invalid hostnames 444 is a special nginx return code that means the request was closed without a response, see: http://nginx.org/en/docs/http/request_processing.html --- roles/nginx/templates/blank-vhost.conf.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/nginx/templates/blank-vhost.conf.j2 b/roles/nginx/templates/blank-vhost.conf.j2 index 2bc6521..39b396f 100644 --- a/roles/nginx/templates/blank-vhost.conf.j2 +++ b/roles/nginx/templates/blank-vhost.conf.j2 @@ -7,7 +7,7 @@ server { listen [::]:80 default; server_name _; - return 403; + return 444; } server { listen 443 ssl http2 default; @@ -34,5 +34,5 @@ server { # of such infrastructure, consider turning off session tickets: ssl_session_tickets off; - return 403; + return 444; }