This repository has been archived by the owner. It is now read-only.
An efficient shared memory IP blocking system for nginx. [Also see ip-blocker-agent]. [Not maintained].
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md Add README May 28, 2016
config Remove pre nginx v1.9.11 compatibility in config Jan 31, 2017
ngx_http_ip_blocker_module.c Fix size of array elem in *set_directive_slot Dec 22, 2016
ngx_http_ip_blocker_rwlock.c Fix build failure w/ newer compiler Mar 14, 2017
ngx_ip_blocker_shm.h

README.md

nginx-ip-blocker

nginx-ip-blocker is the other half of tmthrgd/ip-blocker-agent.

Install

wget http://nginx.org/download/nginx-1.9.15.tar.gz
tar -xzvf nginx-1.9.15.tar.gz
cd nginx-1.9.15/

# Here we assume Nginx is to be installed under /opt/nginx/.
./configure --prefix=/opt/nginx \
	--add-module=/path/to/nginx-ip-blocker

make -j2
make install

Directives

ip_blocker

syntax: ip_blocker <name-of-shared-memory> [whitelist code=xxx] | off

default: ip_blocker off

context: http, server, server if, location, location if

Blocks (or whitelists) IP address specified in the named shared memory (see tmthrgd/ip-blocker-agent).

The whitelist flag causes matches to be accepted rather than denied.

The code flag allows the HTTP code returned for a match to be specified.

The directive may be specified multiple times to specify multiple blocklists. The exact behaviour depends on the value of the satisfy directive.

License

Unless otherwise noted, the nginx-ip-blocker source files are distributed under the Modified BSD License found in the LICENSE file.