lua-cs-bouncer-mcaptcha/nginx/access.lua
2022-01-05 15:10:54 +01:00

8 lines
268 B
Lua

ok, err = require "crowdsec".allowIp(ngx.var.remote_addr)
if err ~= nil then
ngx.log(ngx.ERR, "[Crowdsec] bouncer error: " .. err)
end
if not ok then
ngx.log(ngx.ALERT, "[Crowdsec] denied '" .. ngx.var.remote_addr .. "'")
ngx.exit(ngx.HTTP_FORBIDDEN)
end