Merge pull request #117 from thelittlefireman/patch-9

Fix lua mistake
This commit is contained in:
Bunkerity 2021-04-13 16:49:45 +02:00 committed by GitHub
commit deeb7a76a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -73,7 +73,7 @@ for k, v in pairs(whitelist_uri) do
ngx.log(ngx.WARN, "[WHITELIST] URI " .. v .. " is whitelisted")
ngx.exit(ngx.OK)
end
done
end
-- check if it's certbot
if use_lets_encrypt and string.match(ngx.var.request_uri, "^/.well-known/acme-challenge/") then
@ -97,12 +97,12 @@ end
-- check if user-agent is allowed
if use_user_agent and ngx.var.bad_user_agent == "yes" then
local block = false
for k, v in pairs(whitelist_user_agent) then
for k, v in pairs(whitelist_user_agent) do
if string.match(ngx.var.http_user_agent, v) then
ngx.log(ngx.WARN, "[ALLOW] User-Agent " .. ngx.var.http_user_agent .. " is whitelisted")
block = false
break
fi
end
end
if block then
ngx.log(ngx.WARN, "[BLOCK] User-Agent " .. ngx.var.http_user_agent .. " is blacklisted")