nginx-defender

(★ 79)

A lightweight, real time log monitoring tool designed to detect and block IP addresses exhibiting abusive behavior such as brute force attacks, excessive requests, or suspicious patterns. Automatically integrates with your server’s firewall (iptables or ufw) to block offenders and protect web services without relying on external services.

Showing a partial file list — download the zip above to see everything.

  • .gitignore
  • Dockerfile
  • LICENSE
  • README.md
  • SECURITY.md

# Installation Guide

1. Get the code
git clone https://github.com/Anipaleja/nginx-defender

Downloads the entire project code from GitHub to your computer.

cd nginx-defender

Moves into the project folder you just downloaded.

2. Official Install Script

Easy Recommended
Prerequisites
  • Homebrew A package manager for macOS/Linux.
  • Go Go is required to use go install.
curl -fsSL https://raw.githubusercontent.com/Anipaleja/nginx-defender/main/scripts/install.sh | sh

Downloads and runs the official install script in one line — this handles the full setup automatically.

brew tap anipaleja/nginx-defender

Registers this project's repository (tap) with Homebrew.

brew install nginx-defender

Installs the pre-built package via Homebrew — no source build required.

go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest

Downloads and installs the specified version directly — no need to clone the repo yourself.

After installing, open a new terminal and run the program's version command (e.g. --version) to confirm it worked.

Pulled directly from this repo's README.

3. Docker

Easy
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Docker Desktop Needed to build and run containers. Install it and keep it running in the background.
docker compose up -d

Builds and starts all defined containers (server, database, etc.) at once, in the background.

docker pull ghcr.io/anipaleja/nginx-defender:latest

Type this command into your terminal and run it.

docker run -d \

Runs the built image as an actual container.

Run docker compose ps to check the containers are Up. If the README mentions a port, open http://localhost:PORT in your browser.

Pulled directly from this repo's README.

// repository documentation