nginx-badbot-blocker

Block bad, possibly even malicious web crawlers (automated bots) using Nginx

  • 所有者: mariusv/nginx-badbot-blocker
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Nginx Bad Bot Blocker

223 (and growing) Nginx rules to block bad bots.

Bad bots are defined as:

  • E-mail harvesters
  • Content scrapers
  • Spam bots
  • Vulnerability scanners
  • Aggressive bots that provide little value
  • Bots linked to viruses or malware
  • Government surveillance bots
  • Chinese search engine Baidu
  • Spamhaus IP list block

Installation

If you have a bizarre or complicated setup, be sure to look everything
over before installing. However, for anyone with a fairly straightforward Nginx installation, this should work without any issues.

Step 1.) Clone the Nginx Bad Bot Blocker repository into your Nginx directory.

cd /etc/nginx
git clone https://github.com/mariusv/nginx-badbot-blocker.git

Step 2.) Edit /etc/nginx/nginx.conf and add the following at the end of the http block, before the closing }

##
# Nginx Bad Bot Blocker
##
include nginx-badbot-blocker/blacklist.conf;
include nginx-badbot-blocker/blockips.conf;

Step 3.) Run the following command to verify your Nginx configuration is valid. (Note: You may need to prepend sudo to this command.)

nginx -t

You should get an output that looks something like this:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Step 4.) Reload Nginx and you're all set!

sudo service nginx reload

Further information

Baidu

Unless your website is written in Chinese, you probably don't
get any traffic from them. They mostly just waste bandwidth and consume resources.

Bots Are Liars

Bots try to make themselves look like other software by disguising their
useragent. Their useragents may look harmless, perfectly legitimate even.
For example, "^Java" but according to
Project Honeypot,
it's actually one of the most dangerous.

Spamhaus IP Block

Block Spamhaus Lasso Drop Spam IP Address. (I'll keep this list updated)

UPDATED 16/01/2018

主要指標

概覽
名稱與所有者mariusv/nginx-badbot-blocker
主編程語言Shell
編程語言Shell (語言數: 1)
平台
許可證
所有者活动
創建於2014-04-01 21:28:30
推送於2020-09-03 06:43:17
最后一次提交2020-09-03 08:43:16
發布數3
最新版本名稱2.2017.03 (發布於 2017-07-13 11:02:42)
第一版名稱2.2017.01 (發布於 2017-02-19 17:15:08)
用户参与
星數865
關注者數70
派生數141
提交數458
已啟用問題?
問題數57
打開的問題數10
拉請求數133
打開的拉請求數0
關閉的拉請求數5
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?