Issue
On a server with Imunify360 stand-alone and Nginx the following errors occurs:
nginx: [emerg] ModSecurityConfig in /usr/local/nginx/conf/site.conf:24: Unknown command in config: SecAuditLogFormat
nginx: [emerg] unknown directive "modsecurity" in /usr/local/nginx/conf/conf/site.conf:22
Environment
- Imunify360 stand-alone
- Nginx
- ModSecurity
- Any OS
Solution
It is necessary to check if ModSecurity 3 module is installed on the server, and if it is included in the Nginx configuration.
# grep -ri "modsecurity" /etc/nginx/
...
load_module modules/ngx_http_modsecurity_module.so;
...
modsecurity on;
modsecurity_rules_file /etc/nginx/modsec.conf;
modsecurity_rules_file /etc/sysconfig/imunify360/generic/modsec.conf;
...
This error can occur on servers where ModSecurity 3 module is not installed at all, or ModSecurity 2 is installed for Nginx (this configuration is not supported by Imunify360).
Cause
The error may be caused by incorrect installation of ModSecurity 3 for Nginx, or installation of ModSecurity 2 instead of version 3.
Useful links
- https://cloudlinux.zendesk.com/hc/en-us/articles/360018872859-How-to-install-ModSecurity-on-the-nginx-only-server-
- https://docs.imunify360.com/stand_alone/#nginx
Comments
0 comments
Please sign in to leave a comment.