diff --git a/openresty/crowdsec_openresty.conf b/openresty/crowdsec_openresty.conf index 457111a..04905a6 100644 --- a/openresty/crowdsec_openresty.conf +++ b/openresty/crowdsec_openresty.conf @@ -16,7 +16,16 @@ init_by_lua_block { end } +map $server_addr $unix { + default 0; + "~unix:" 1; +} + access_by_lua_block { local cs = require "crowdsec" - cs.Allow(ngx.var.remote_addr) -} \ No newline at end of file + if ngx.var.unix == "1" then + ngx.log(ngx.DEBUG, "[Crowdsec] Unix socket request ignoring...") + else + cs.Allow(ngx.var.remote_addr) + end +}