fix lua crash 2
This commit is contained in:
parent
605d59a45c
commit
ee8aaa4e7e
@ -73,7 +73,7 @@ for k, v in pairs(whitelist_uri) do
|
|||||||
ngx.log(ngx.WARN, "[WHITELIST] URI " .. v .. " is whitelisted")
|
ngx.log(ngx.WARN, "[WHITELIST] URI " .. v .. " is whitelisted")
|
||||||
ngx.exit(ngx.OK)
|
ngx.exit(ngx.OK)
|
||||||
end
|
end
|
||||||
done
|
end
|
||||||
|
|
||||||
-- check if it's certbot
|
-- check if it's certbot
|
||||||
if use_lets_encrypt and string.match(ngx.var.request_uri, "^/.well-known/acme-challenge/") then
|
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
|
-- check if user-agent is allowed
|
||||||
if use_user_agent and ngx.var.bad_user_agent == "yes" then
|
if use_user_agent and ngx.var.bad_user_agent == "yes" then
|
||||||
local block = false
|
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
|
if string.match(ngx.var.http_user_agent, v) then
|
||||||
ngx.log(ngx.WARN, "[ALLOW] User-Agent " .. ngx.var.http_user_agent .. " is whitelisted")
|
ngx.log(ngx.WARN, "[ALLOW] User-Agent " .. ngx.var.http_user_agent .. " is whitelisted")
|
||||||
block = false
|
block = false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user