--- src/common/core/reverseproxy/confs/server-http/reverse-proxy.conf.orig	2026-09-21 08:05:39 UTC
+++ src/common/core/reverseproxy/confs/server-http/reverse-proxy.conf
@@ -130,13 +130,17 @@
 location {% if url_modifier %}{{ url_modifier }} {% endif %}"{{ quoted_url }}" {
 	etag off;
 			{% if USE_MODSECURITY == "yes" and modsecurity_location == "no" %}
+	{% if has_modsecurity %}
 	modsecurity off;
+	{% endif %}
 			{% endif %}
 			{% if max_client_size != "" %}
 	client_max_body_size {{ max_client_size }};
 				{% if USE_MODSECURITY == "yes" and modsecurity_location != "no" %}
 					{% set max_client_size_bytes = (max_client_size[:-1]|int * {"k": 1024, "K": 1024, "m": 1048576, "M": 1048576, "g": 1073741824, "G": 1073741824}[max_client_size[-1]]) if max_client_size[-1] in "kKmMgG" else max_client_size|int %}
+	{% if has_modsecurity %}
 	modsecurity_rules 'SecRequestBodyLimit {{ max_client_size_bytes }}';
+	{% endif %}
 				{% endif %}
 			{% endif %}
 	set $backend{{ index }} "{{ host }}";
