From c68b45c80d3b3b5d9982cfd567bc750ac0bd0b8d Mon Sep 17 00:00:00 2001 From: Laurence Jones Date: Fri, 3 Nov 2023 13:43:01 +0000 Subject: [PATCH] Update crowdsec_nginx.conf --- nginx/crowdsec_nginx.conf | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/nginx/crowdsec_nginx.conf b/nginx/crowdsec_nginx.conf index 2141660..113b8f0 100644 --- a/nginx/crowdsec_nginx.conf +++ b/nginx/crowdsec_nginx.conf @@ -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 }