Issue
On a server with Imunify360, Nginx, and ModSecurity 3, the nginx -t command and the restart of the Nginx service itself are slow.
Environment
- Imunify360 stand-alone
- ModSecurity
- Nginx
Solution
It is necessary to check exactly how ModSecurity is included in the Nginx configuration. If there is a separate rules configuration for each domain, this could be the cause of problems, because each include of config file with rules, for each domain, will be handled when testing the config or restarting Nginx one by one.
The solution here is to include the ModSecurity configuration and rules once, in the global config, and add only the necessary exceptions and additional rules to each virtual host's config, and only if needed.
In this way, the configuration will be loaded once, but will apply to all virtual hosts on the server.
Comments
0 comments
Please sign in to leave a comment.