rules_enabled

The `rules_enabled` directive in the NGINX Anti XSS & SQL Injection module enables or disables the application of defined security rules.

Syntaxrules_enabled;
Defaultoff
Contexthttp, server, location, limit_except
Argumentsnone

Description

The rules_enabled directive is a configuration option within the NGINX Anti XSS & SQL Injection (Naxsi) module that allows users to enable or disable the application of defined security rules against incoming requests. When set to 'on', the server actively applies the specified rules to filter out potentially malicious requests that could exploit vulnerabilities such as Cross-Site Scripting (XSS) or SQL Injection attacks. Conversely, setting this directive to 'off' disables these protections, effectively allowing all requests to pass without being scrutinized by the filtering logic embedded in Naxsi.

In practice, this directive is crucial for web administrators who seek to strike a balance between security and functionality. By enabling the rules, administrators can leverage the predefined patterns in the Naxsi module to prevent common attack vectors effectively. On the other hand, during testing or troubleshooting phases, they might choose to turn this directive 'off' temporarily to ensure that legitimate requests are not being blocked or altered by the security rules. It is important to be cautious with this directive, as disabling rules may expose the application to potential vulnerabilities, especially in a production environment.

Config Example

http {
    rules_enabled;
}

Ensure that rules are properly defined; otherwise enabling this may lead to false positives.

Disabling rules_enabled may expose your application to security risks; use with caution.

If you change the directive status, be aware that it may take effect only after reloading or restarting NGINX.

← Back to all directives