Skip to content

Instantly share code, notes, and snippets.

@net1
net1 / example_host.conf
Created December 9, 2022 10:15 — forked from rm3nchaca/example_host.conf
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;