NGINX set up with ModSecurity enabled and configured with Open Web Application Security Project Core Rule Set (OWASP CRS). All running on docker.
docker run --name nginx-modsec -d -p 80:80 marknjunge/nginx-modsec
git clone https://marknjunge.com/nginx-modsec.git
cd nginx-modsec
docker build -t marknjunge/nginx-modsec
or
./build.sh
Note: Building takes a while (even up to 15 minutes) because of compiling ModSecurity. Unless you have reason not to, it's better to use my image marknjunge/nginx-modsec
as a base and copy your own config files.
docker run --name nginx-modsec -d -p 80:80 marknjunge/nginx-modsec
To modify NGINX Configuration, edit ./nginx/nginx.conf and ./nginx/conf.d/.
ModSecurity is pre-configured with OWASP CRS.
To add your own rules, modify ./modsec/main.conf.