Fix definition order of modsecurity directives for controller to match PR 5315 (#6940) (#7323)

* Fix definition order of modsecurity directives for controller to match PR 5315

* Add a test
This commit is contained in:
Kyle Michel 2021-07-06 22:24:43 -04:00 committed by GitHub
parent a064337621
commit 12a2a6d0e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 82 additions and 4 deletions

View file

@ -149,14 +149,16 @@ http {
{{ if $all.Cfg.EnableModsecurity }}
modsecurity on;
{{ if (not (empty $all.Cfg.ModsecuritySnippet)) }}
modsecurity_rules '
{{ $all.Cfg.ModsecuritySnippet }}
';
{{ end }}
modsecurity_rules_file /etc/nginx/modsecurity/modsecurity.conf;
{{ if $all.Cfg.EnableOWASPCoreRules }}
modsecurity_rules_file /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf;
{{ else if (not (empty $all.Cfg.ModsecuritySnippet)) }}
modsecurity_rules '
{{ $all.Cfg.ModsecuritySnippet }}
';
{{ end }}
{{ end }}