You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Allow method calls ngx.exit regardless of the bouncer's decision, which prevents any other scripts inside access_by_lua_block to be executed after the bouncer.
It would be very handy to have another version of Allow that either:
Returns boolean value regardless of the decision, similarly to allowIp;
Simply returns on successful pass. In this case, the bouncer would handle all rejections and if the request passes by the bouncer, it can be handled by one of the next scripts.
The text was updated successfully, but these errors were encountered:
I need this functionality as well. I have a scenario where I want to use crowdsec nginx bouncer in a "catch-all" location block and have any allowed requests redirect.
This isn't possible using the normal, declarative directives because return invokes in the rewrite phase, before access phase (and bouncer runs), so ideally I could get around this instead rewriting in lua block after cs by doing
access_by_lua_block {
local cs = require "crowdsec"
if ngx.var.unix == "1" then
ngx.log(ngx.DEBUG, "[Crowdsec] Unix socket request ignoring...")
else
cs.Allow(ngx.var.remote_addr)
ngx.req.set_method(ngx.HTTP_GET)
return ngx.redirect("https://myTLD.com")
end
}
BUT since Allow calls exit execution is ended before my code can be used.
Currently,
Allow
method callsngx.exit
regardless of the bouncer's decision, which prevents any other scripts insideaccess_by_lua_block
to be executed after the bouncer.It would be very handy to have another version of
Allow
that either:allowIp
;The text was updated successfully, but these errors were encountered: