Skip to content

Quickly deploy Nginx with ModSecurity, the ModSecurity-nginx connector, and OWASP CRS using ready-to-use scripts and configuration templates.

Notifications You must be signed in to change notification settings

JustDaile/bootstrap-nginx-modsec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nginx + ModSecurity Bootstrap Setup

This project provides a script to build and install Nginx with ModSecurity v3, the ModSecurity-nginx connector, and the OWASP Core Rule Set (CRS).

By default, the following versions will be installed:

  • Nginx: v1.29.1
  • ModSecurity: v3.0.14
  • ModSecurity-nginx: v1.0.4
  • OWASP CRS: v3.2.0

References


Preparation

  1. Ensure that Nginx is not currently installed.
    If it is, back up your configuration files and remove the /etc/nginx directory and existing Nginx executable.

  2. Review the configuration templates provided in this repository:

    • modsec.main.conf
    • nginx.conf
    • nginx.service

    You can modify these files, but do not rename them.


Clone the Repository

git clone https://github.com/JustDaile/bootstrap-nginx-modsec.git
cd bootstrap-nginx-modsec
chmod +x nginx-modsec-setup.sh

Installation

Run the setup script:

./nginx-modsec-setup.sh

Optional flags are available. To see them, run:

./nginx-modsec-setup.sh --help

Note: Compiling ModSecurity from source may take ~10 minutes depending on your system. Don’t worry if it seems stuck at Compiling and installing ModSecurity.


support me

About

Quickly deploy Nginx with ModSecurity, the ModSecurity-nginx connector, and OWASP CRS using ready-to-use scripts and configuration templates.

Resources

Stars

Watchers

Forks

Languages