Fix definition order of modsecurity directives
This commit is contained in:
parent
b33c9a21a5
commit
5390ce4879
3 changed files with 85 additions and 11 deletions
|
|
@ -1360,12 +1360,6 @@ func buildModSecurityForLocation(cfg config.Configuration, location *ingress.Loc
|
|||
|
||||
if !isMSEnabled {
|
||||
buffer.WriteString(`modsecurity on;
|
||||
modsecurity_rules_file /etc/nginx/modsecurity/modsecurity.conf;
|
||||
`)
|
||||
}
|
||||
|
||||
if !cfg.EnableOWASPCoreRules && location.ModSecurity.OWASPRules {
|
||||
buffer.WriteString(`modsecurity_rules_file /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf;
|
||||
`)
|
||||
}
|
||||
|
||||
|
|
@ -1381,6 +1375,16 @@ modsecurity_rules_file /etc/nginx/modsecurity/modsecurity.conf;
|
|||
`, location.ModSecurity.TransactionID))
|
||||
}
|
||||
|
||||
if !isMSEnabled {
|
||||
buffer.WriteString(`modsecurity_rules_file /etc/nginx/modsecurity/modsecurity.conf;
|
||||
`)
|
||||
}
|
||||
|
||||
if !cfg.EnableOWASPCoreRules && location.ModSecurity.OWASPRules {
|
||||
buffer.WriteString(`modsecurity_rules_file /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf;
|
||||
`)
|
||||
}
|
||||
|
||||
return buffer.String()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue