ModSecurity-nginx icon indicating copy to clipboard operation
ModSecurity-nginx copied to clipboard

Amazon-linux: unknown directive.

Open Luke-SF opened this issue 8 months ago • 1 comments

I run the compilation in AWS-linux 2023 as in the readme:

$ ./build.sh
$ ./configure
$ make
$ sudo make install

Now it seems to complete but after restarting the standard Nginx package, with "modsecurity on" added to config, I get:

nginx: [emerg] unknown directive "modsecurity" in (config file)

Is there a step missing to recompile all of Nginx or, enable the module I compiled?

Luke-SF avatar Apr 17 '25 18:04 Luke-SF

Hi @Luke-SF,

based on your information I assume you compiled the library (libmodsecurity3).

If you want to use that for your Nginx, you should compile the connector module too, and you need to enable that.

Here you can find information about compilation.

If you build the module as a dynamic module, you should load that with this line:

load_module modules/ngx_http_modsecurity_module.so;

airween avatar Apr 17 '25 18:04 airween