• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved What is the best way to configure NGINX ModSecurity?

othmaqsa

Regular Pleskian
Server operating system version
Ubuntu 20.04.5 LTS
Plesk version and microupdate number
18.0.49
Hello,

What is the best way to configure Modsecurity ? I use only NGINX.

Thank you.
 
Please check the documentation here:
Hello,

Thank you for your message.

I've read this before, but the confusion is that in the documentation:
Apache (ModSecurity 2.9) (recommended).
Nginx (ModSecurity 3.0).
Note: Switching to Nginx (ModSecurity 3.0) may affect your existing applications. We recommend trying ModSecurity 3.0 out on a test server before switching your production environment to that version.


In my case, I use only NGINX only (proxy mode disabled), I need to choose the recommended setting or go Nginx (ModSecurity 3.0) ?
 
If you haven't used ModSecurity before then you should go for ModSecurity 3.0 with nginx and run it in "Detection Mode" only for a while and analyse the logs it produces.

Once you're sure that no legitimate requests would be blocked then you can switch to "On" (blocking mode).
 
If you haven't used ModSecurity before then you should go for ModSecurity 3.0 with nginx and run it in "Detection Mode" only for a while and analyse the logs it produces.

Once you're sure that no legitimate requests would be blocked then you can switch to "On" (blocking mode).
Got it, since it's the first time I use ModSecurity, I'll enable ModSecurity 3.0 with nginx.

Another question: Can I see the Logs with the option Detection Mode ? If yes, where can I see it ?
 

Have a look at the log files section here
@Monty Last questions please: I would like to know, please, the average consumption (CPU/RAM) ? In general, can ModSecurity cause cpu/ram spikes during use?
 
ModSecurity will have a CPU impact, yes. But with a "normal" amount of rules this impact should be very small, close to negligible. To see the impact, record your CPU/RAM usage before activating ModSecurity and then compare it with ModSecurity enabled.

For further tuning and optimization of ModSecurity: ModSecurity Performance Recommendations
 
Back
Top