From 207a20bf93905806af4999b8448a7faabcd3d089 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sat, 17 Aug 2019 22:22:30 +0200 Subject: [PATCH] nginx_ua_block_pleroma_rejects: Put ~* directly in front of domain. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If there is a space between ~* and domain, nginx complains about “invalid number of the map parameters”. --- nginx_ua_block_pleroma_rejects.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nginx_ua_block_pleroma_rejects.sh b/nginx_ua_block_pleroma_rejects.sh index 32b922d..bbda118 100755 --- a/nginx_ua_block_pleroma_rejects.sh +++ b/nginx_ua_block_pleroma_rejects.sh @@ -4,7 +4,7 @@ # Save the output to a file and include it in an nginx configuration file. Then # add `if ($blockedagent) { return 403; }` to your server blocks. -# Version: 2019-08-17_1 +# Version: 2019-08-17_2 function get_domains() # Outputs domains, separated by newline. @@ -23,7 +23,7 @@ function print_entry() # Filter out wildcard domains. if ! [[ "${domain}" =~ "\*" ]]; then domain=$(sed 's/\./\\./g' <<<${domain}) - echo " ~* ${domain} 1;" + echo " ~*${domain} 1;" fi }