V
V
Vadim Timoshenko2018-11-21 16:17:31
Nginx
Vadim Timoshenko, 2018-11-21 16:17:31

How to disable mod_security in NGINX?

There was a problem with the site. I contacted the CMS developer. He advised to disable mod_security .
I tried to insert the code in .htaccess:

<IfModule mod_security2.c>
SecRuleEngine Off
</IfModule>

There is no sense. Maybe somehow on the server it turns off? Do I even have it? Where can I find out if it is available and if it is included at all?
NGINX Server + PHP7.2-FPM.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Burov, 2018-11-21
@PbI6A_KuT

If you actually have modsecurity installed under nginx, then:
https://www.trustwave.com/Resources/SpiderLabs-Blo...
You can find out if it is installed using nginx -V

S
Softer, 2018-11-21
@Softer

Do I even have it?

No. This is an apache module. As well as the crutch .htaccess.

B
Boris Syomov, 2018-11-21
@kotomyava

There is no mod_security in nginx, and nginx does not process .htaccess at all. So if the conversation is only about him, then the problem is somewhere else.
If there is apache behind nginx, then apache2ctl -M (or apachectl, depending on which distribution you have) will show which modules you have connected.
And if mod_security is there, but it is not turned off via .htaccess, then maybe you just do not have processing enabled (AllowOverride).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question