Skip to content

Commit

Permalink
Merge pull request #47 from crowdsecurity/dedtect_unix_socket
Browse files Browse the repository at this point in the history
Update crowdsec_nginx.conf
  • Loading branch information
LaurenceJJones authored Nov 3, 2023
2 parents 24564d9 + c68b45c commit 4e1d4c9
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 4e1d4c9

Please sign in to comment.