commit
deeb7a76a2
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue