Skip to content

Instantly share code, notes, and snippets.

@rm3nchaca
rm3nchaca / example_host.conf
Created November 30, 2015 22:59
Simple script for blocking attacker bots with nginx and a lua script
server {
listen 80;
server_name example.com;
root /www/example;
access_by_lua 'denyip()'; #check error counter
error_page 400 404 405 406 = /404.html;
location = /404.html {
set $inc 1; #this is useful for blocking website scanners
set_by_lua $err 'incerror()' $inc;