From ff3c608a5b1eb48e1528b4f7a952c58f49e3658b Mon Sep 17 00:00:00 2001 From: mley Date: Wed, 9 Aug 2023 14:45:18 -0700 Subject: [PATCH 1/2] Disable Modsecurity from interanl processing --- rootfs/etc/nginx/template/nginx.tmpl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rootfs/etc/nginx/template/nginx.tmpl b/rootfs/etc/nginx/template/nginx.tmpl index b18a8da4d9..9d1a21a3c2 100644 --- a/rootfs/etc/nginx/template/nginx.tmpl +++ b/rootfs/etc/nginx/template/nginx.tmpl @@ -710,6 +710,11 @@ http { # default server, used for NGINX healthcheck and access to nginx stats server { + # Ensure that modsecurity will not run on an internal location as this is not accessible from outside + {{ if $modsecurityEnabled }} + modsecurity off; + {{ end }} + listen 127.0.0.1:{{ .StatusPort }}; set $proxy_upstream_name "internal"; From e645e857288f16aabb38e2f723030b93acdbef58 Mon Sep 17 00:00:00 2001 From: mley Date: Thu, 10 Aug 2023 11:07:36 -0700 Subject: [PATCH 2/2] Fix modsecurity check logic --- rootfs/etc/nginx/template/nginx.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/etc/nginx/template/nginx.tmpl b/rootfs/etc/nginx/template/nginx.tmpl index 9d1a21a3c2..0d313816c6 100644 --- a/rootfs/etc/nginx/template/nginx.tmpl +++ b/rootfs/etc/nginx/template/nginx.tmpl @@ -711,7 +711,7 @@ http { # default server, used for NGINX healthcheck and access to nginx stats server { # Ensure that modsecurity will not run on an internal location as this is not accessible from outside - {{ if $modsecurityEnabled }} + {{ if $all.Cfg.EnableModsecurity }} modsecurity off; {{ end }}