From 174b54c9f9ffe11666f17dde16b9de0911f7e98e Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 15 Nov 2017 01:05:07 +0100 Subject: [PATCH] nginx: return 404 when someone tries to access files or directories that start with a . --- nginx/templates/nginx-virthost.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nginx/templates/nginx-virthost.j2 b/nginx/templates/nginx-virthost.j2 index a2f895c4..709a4145 100644 --- a/nginx/templates/nginx-virthost.j2 +++ b/nginx/templates/nginx-virthost.j2 @@ -5,6 +5,7 @@ server { deny all; access_log off; log_not_found off; + return 404; } {% if letsencrypt_acme_install %} ## Disable .htaccess and other hidden files @@ -46,6 +47,7 @@ server { deny all; access_log off; log_not_found off; + return 404; } {% if haproxy_ips is defined %} # We are behind haproxy