From 4b50bf09efa9d3c93373bb20d566d9d19a20ac1c Mon Sep 17 00:00:00 2001 From: Stuart Cardall Date: Mon, 26 Feb 2018 22:54:03 +0000 Subject: [PATCH] improve regex for root directive check * to fix https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/138 --- setup-ngxblocker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-ngxblocker b/setup-ngxblocker index d9c19581a..9208b5081 100755 --- a/setup-ngxblocker +++ b/setup-ngxblocker @@ -401,7 +401,7 @@ main() { # do not use wildcards in vhost files printf "%-10s %-${col_size}s %s\n" "WARN:" "$BOTS_DIR/* detected" "=> $file" else # do not add includes to vhosts without root directive (i.e redirects) - if grep -Ew [[:space:]]+root $file 1>/dev/null; then + if grep -Ew ^[[:space:]]+root $file 1>/dev/null; then add_includes $line $file $BOTS_DIR $col_size $VHOST_INCLUDES fi fi