From 7f09d1d812681c5396e40c1715d8b244da845841 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 3 May 2024 18:51:15 +0200 Subject: [PATCH] Fix the dotfiles regexp, finally. --- templates/nginx-virthost.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/nginx-virthost.j2 b/templates/nginx-virthost.j2 index 90a60ca..2a7f9a0 100644 --- a/templates/nginx-virthost.j2 +++ b/templates/nginx-virthost.j2 @@ -31,6 +31,7 @@ upstream {{ u_bk.name }} { server { listen {{ item.http_port | default ('80') }}; server_name {{ item.server_name }} {% if item.serveraliases is defined %}{{ item.serveraliases }}{% endif %}; + {% if nginx_block_dotfiles %} location ~ /\.(?!well-known).* { deny all; @@ -39,7 +40,7 @@ server { return 404; } {% elif nginx_block_dangerous_dotfiles %} - location ~ /\.(?ht).* { + location ~ /\.ht.* { deny all; access_log off; log_not_found off; @@ -256,9 +257,8 @@ server { log_not_found off; return 404; } -{% endif %} {% elif nginx_block_dangerous_dotfiles %} - location ~ /\.(?ht).* { + location ~ /\.ht.* { deny all; access_log off; log_not_found off;