This repository contains a bash script for installing Nginx with ModSecurity 3 support. The script also includes features for checking and managing previous Nginx installations, and supports automatic service restarts.
- Direct install on host or vm using vm script
- Install on Proxmox
- Install Nginx with ModSecurity 3 support
- Automatic detection and removal of prior Nginx installations
- Customizable Nginx and ModSecurity versions
- Supports automatic service restarts
- Fall-back mechanism for downloading utility functions using
wget
ifcurl
is not available
- A debain linux-based operating system (tested on ubuntu 22.04.01)
- A Proxmox VE 7.4-11 Minimum
- A Proxmox VE 8 Is in Testing
- wget installed
- Root privileges for installation
- Network connection for downloading necessary files
Download and install via bash on your local machine:
sudo bash -c "$(wget -qLO - https://raw.githubusercontent.com/mashiahd/1minute_waf/main/platform/vm/modsec_nginx.sh)"
Download and install via bash on lxc conatiner (Linux Container):
sudo bash -c "$(wget -qLO - https://raw.githubusercontent.com/mashiahd/1minute_waf/main/platform/proxmox_ct/modsec_nginx_proxmox.sh)"
If repository cloned run the script with or without command-line arguments:
sudo chmod +x ./plaform/vm/modsec_nginx.sh
sudo ./plaform/vm/modsec_nginx.sh [options]
Note
The script still calls utils.func from this github - will be fixed.
sudo chmod +x ./plaform/proxmox_ct/modsec_nginx_proxmox.sh
sudo ./plaform/proxmox_ct/modsec_nginx_proxmox.sh [options]
Note
The script still calls utils.func and modsec_nginx.sh from this github - will be fixed.
-auto_restart <yes|no>
Auto services restart (default: yes)
-remove_nginx <yes|no>
Remove prior Nginx installation (default: yes)
-nginx_ver <version>
Nginx version to install (default: 1.25.2)
-modsec_ver <version>
ModSecurity version to install (default: v3.0.8)
-h, -?, -help
Display this help message
If no arguments are provided, the script will use the following default values:
- Auto services restart:
yes
- Remove prior Nginx installation:
yes
- Nginx version:
1.25.2
- ModSecurity version:
v3.0.8
Before proceeding with the installation, you will be prompted to confirm these default values.
If you encounter any issues during the installation, check the 1minwaf_install.log
file located in the same directory for detailed logs.
Common issues:
- Ensure you have root privileges to run the script.
- Check your network connection for downloading necessary files.