Fix issue in logic of modsec template
according to go templates: `(and ((not false) false))` == `true` the only way to remove the owasp rules from every location is to disable modsec on that location, or to enable owasp globally, both not-so-great choices. This commit fixes the logic issue by fixing the and-clause in the if-statement. As a result this reduces global resource usages when modsecurity is configured globally, but not on every location.
This commit is contained in:
parent
de12fc16f0
commit
75e8d37d71
1 changed files with 1 additions and 1 deletions
|
@ -1041,7 +1041,7 @@ stream {
|
|||
modsecurity_rules '
|
||||
{{ $location.ModSecurity.Snippet }}
|
||||
';
|
||||
{{ else if (and ((not $all.Cfg.EnableOWASPCoreRules) $location.ModSecurity.OWASPRules))}}
|
||||
{{ else if (and (not $all.Cfg.EnableOWASPCoreRules) ($location.ModSecurity.OWASPRules))}}
|
||||
modsecurity_rules_file /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf;
|
||||
{{ end }}
|
||||
|
||||
|
|
Loading…
Reference in a new issue