ABOUT:

For any users trying to compile the ModSecurity module for nginx 1.21.5 and up, there are some changes to be made according to this github issue. 2.

The issue is related to a change in nginx (now nginx is built with the PCRE2 library by default). PCRE2 support must be added to the library (libmodsecurity) and then to the connector. Applying just the connector’s PR will lead to enormous memory leaks in regex processing.

TUTORIAL

Long story short: use --without-pcre2 configure argument when building ModSecurity-nginx V3 connector module.

So your full module configure line should look like this:
./configure --with-compat --without-pcre2 --add-dynamic-module=/usr/local/src/ModSecurity-nginx

DONATE! If this tutorial it worked for you (which it should have), you could spread the love back and donate some change to my paypal, bitcoin address, or altcoin addresses.

PAYPAL:

BITCOIN (BTC) ADDRESS:

bc1qxsqy0nl8f2rqsgpzzr8eh3c67vz7kjr2djyku4

BITCOIN CASH (BCH) ADDRESS:

qzdkv8sz8zf57urafd8urhg7jdej6u892v3z088nvr

ETHEREUM (ETH) ADDRESS:

0x8C33CD44a083D605DBb65Ba4eC201f30Af88705c

ZCASH (ZEC) ADDRESS:

t1dxu9KN1pSYNoMNxYMzCNhcHJhGZmwPW9n

MONERO (XMR) ADDRESS:

4A2p4k6vSGviUxoZvwQkAX8VBQE6tQncmZUS5mZ8YS9cZ2BQ4cc2CZXdMVg4vtFoxh3XrXQECWm95Gq2FpyRtvFz2yNZuYy

FINISHED!