fix lua crash 2

This commit is contained in:
thelittlefireman 2021-04-11 15:45:46 +02:00 committed by GitHub
parent 605d59a45c
commit ee8aaa4e7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 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,7 +97,7 @@ 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