Skip to content

Commit

Permalink
Update crowdsec_nginx.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenceJJones authored Nov 3, 2023
1 parent 24564d9 commit c68b45c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions nginx/crowdsec_nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@ init_by_lua_block {
ngx.log(ngx.ALERT, "[Crowdsec] Initialisation done")
}

map $server_addr $unix {
default 0;
"~unix:" 1;
}

access_by_lua_block {
local cs = require "crowdsec"
cs.Allow(ngx.var.remote_addr)
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)
end
}

0 comments on commit c68b45c

Please sign in to comment.