Skip to content

Commit

Permalink
Update crowdsec_openresty.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenceJJones authored Nov 3, 2023
1 parent 502d65f commit 15df7b1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions openresty/crowdsec_openresty.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
if ngx.var.unix == "1" then
ngx.log(ngx.DEBUG, "[Crowdsec] Unix socket request ignoring...")
else
cs.Allow(ngx.var.remote_addr)
end
}

0 comments on commit 15df7b1

Please sign in to comment.