mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-01 10:09:49 +00:00
V2.2017.04 - Added new include files method for whitelisting your own IP’s and Domain Names
This commit is contained in:
parent
477b85609e
commit
c7acdfa822
7 changed files with 58 additions and 59 deletions
|
@ -1,5 +1,10 @@
|
|||
#CHANGELOG - Nginx Bad Bot Blocker
|
||||
|
||||
###2017-02-16
|
||||
- V2.2017.04 Added new include file methods for whitelisting your own domains and IP addresses.
|
||||
No more having to remember to include your own IP ranges with any future update.
|
||||
**Please read updated configuration instructions.** on README.md
|
||||
|
||||
###2017-02-08
|
||||
- V2.2017.03 - Added Travis CI Build Checking and Various Readme File Updates
|
||||
|
||||
|
|
|
@ -142,35 +142,3 @@ server {
|
|||
```
|
||||
|
||||
### If this helped you [You can buy me a beer](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BKF9XT6WHATLG):beer: or send some cheese for my mouse [](https://www.gitcheese.com/app/#/projects/92bf5669-7d2c-447d-baa4-216ac9e720a6/pledges/create)
|
||||
|
||||
## CLOUDFLARE CPanel Users
|
||||
If you are running a CPanel system that is running through Cloudflare (quite likely) you should whitelist all the following ranges including of course your own IP(s). Considering adding this as a permament whitelist in the bot blocker by default.
|
||||
|
||||
```
|
||||
127.0.0.1/32;
|
||||
YOUR.OWN.IP.ADDR;
|
||||
103.21.244.0/22;
|
||||
103.22.200.0/22;
|
||||
103.31.4.0/22;
|
||||
104.16.0.0/12;
|
||||
108.162.192.0/18;
|
||||
131.0.72.0/22;
|
||||
141.101.64.0/18;
|
||||
162.158.0.0/15;
|
||||
172.64.0.0/13;
|
||||
173.245.48.0/20;
|
||||
188.114.96.0/20;
|
||||
190.93.240.0/20;
|
||||
197.234.240.0/22;
|
||||
198.41.128.0/17;
|
||||
199.27.128.0/21;
|
||||
2400:cb00::/32;
|
||||
2606:4700::/32;
|
||||
2803:f800::/32;
|
||||
2405:b500::/32;
|
||||
2405:8100::/32;
|
||||
2c0f:f248::/32
|
||||
2a06:98c0::/29
|
||||
```
|
||||
|
||||
### If this helped you [You can buy me a beer](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BKF9XT6WHATLG):beer: or send some cheese for my mouse [](https://www.gitcheese.com/app/#/projects/92bf5669-7d2c-447d-baa4-216ac9e720a6/pledges/create)
|
45
README.md
45
README.md
|
@ -10,7 +10,7 @@
|
|||
# Nginx Bad Bot and User-Agent Blocker, Spam Referrer Blocker, Anti DDOS, Bad IP Blocker and Wordpress Theme Detector Blocker
|
||||
##### The Ultimate Nginx Bad Bot, User-Agent, Spam Referrer Blocker, Adware, Malware and Ransomware Blocker, Clickjacking Blocker, Click Re-Directing Blocker and Bad IP Blocker with Anti DDOS System, Nginx Rate Limiting and Wordpress Theme Detector Blocking
|
||||
|
||||
### Version 2.2017.03
|
||||
### Version 2.2017.04
|
||||
|
||||
##### Created by: https://github.com/mitchellkrogza
|
||||
##### Copyright Mitchell Krog <mitchellkrog@gmail.com>
|
||||
|
@ -131,29 +131,7 @@ Copy the contents of **/conf.d/globalblacklist.conf** into your /etc/nginx/conf.
|
|||
|
||||
`sudo wget https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/conf.d/globalblacklist.conf`
|
||||
|
||||
##Step 2:
|
||||
|
||||
Whitelist all your own domain names
|
||||
|
||||
`sudo nano /etc/conf.d/globalblacklist.conf`
|
||||
|
||||
Scroll down until you find the block starting with:
|
||||
|
||||
```
|
||||
# ***********************************
|
||||
# Whitelist all your OWN IP addresses
|
||||
# ***********************************
|
||||
```
|
||||
|
||||
Add your own ip addresses to make sure they are whitelisted (one per line as per this example)
|
||||
|
||||
```
|
||||
127.0.0.1 0;
|
||||
192.168.0.1 0;
|
||||
192.168.1.1 0;
|
||||
```
|
||||
|
||||
##Step 3:
|
||||
##Step 2:
|
||||
|
||||
- From your command line in Linux type
|
||||
|
||||
|
@ -170,6 +148,25 @@ Add your own ip addresses to make sure they are whitelisted (one per line as per
|
|||
|
||||
`sudo wget https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/bots.d/ddos.conf`
|
||||
|
||||
##Step 3:
|
||||
|
||||
Whitelist all your own domain names and IP addresses. **Please note important changes**, this is now done using include files so that you do not have to keep reinserting your whitelisted domains and IP addresses every time you update.
|
||||
|
||||
`cd /etc/nginx/bots.d`
|
||||
|
||||
- copy the whitelist-ips.conf file into that folder
|
||||
|
||||
`sudo wget https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/bots.d/whitelist-ips.conf`
|
||||
|
||||
|
||||
- copy the whitelist-domains.conf file into the same folder
|
||||
|
||||
`sudo wget https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/bots.d/whitelist-domains.conf`
|
||||
|
||||
Use nano, vim or any other text editor to edit both whitelist-ips.conf and whitelist-domains.conf to include all your own domain names and IP addresses that you want to specifically whitelist from the blocker script.
|
||||
|
||||
When pulling any future updates now you can simply pull the latest globalblacklist.conf file and it will automatically include your whitelisted domains and IP addresses.
|
||||
|
||||
|
||||
##Step 4:
|
||||
|
||||
|
|
1
bots.d/whitelist-domains.conf
Normal file
1
bots.d/whitelist-domains.conf
Normal file
|
@ -0,0 +1 @@
|
|||
"~*~*mydomain.com" 0;
|
1
bots.d/whitelist-ips.conf
Normal file
1
bots.d/whitelist-ips.conf
Normal file
|
@ -0,0 +1 @@
|
|||
127.0.0.1 0;
|
|
@ -2,7 +2,7 @@
|
|||
### THE ULTIMATE NGINX BAD BOT BLOCKER
|
||||
### **********************************
|
||||
|
||||
### Version 2.2017.03
|
||||
### Version 2.2017.04
|
||||
|
||||
### This file implements a checklist / blacklist for good user agents, bad user agents and
|
||||
### bad referrers. It also has whitelisting for your own IP's and known good IP Ranges
|
||||
|
@ -875,8 +875,10 @@ map $http_referer $bad_referer {
|
|||
# ************************************
|
||||
|
||||
# Add your own domain names here to spare them from referer checking (one per line)
|
||||
# Use the new include file method so any further updates will no longer require you to
|
||||
# have to keep putting your whitelisted domains here when updating.
|
||||
|
||||
"~*~*mydomain.com" 0;
|
||||
include /etc/nginx/bots.d/whitelist-domains.conf;
|
||||
|
||||
# START BAD REFERERS ### DO NOT EDIT THIS LINE AT ALL ###
|
||||
"~*000free.us" 1;
|
||||
|
@ -4836,7 +4838,10 @@ geo $validate_client {
|
|||
|
||||
# Whitelist all your own IP addresses from any validate_client checks
|
||||
# Add all your IP addresses and ranges below (one per line)
|
||||
127.0.0.1 0;
|
||||
# Use the new include file method so any further updates will no longer require you to
|
||||
# have to keep putting your whitelisted IP addresses here when updating.
|
||||
|
||||
include /etc/nginx/bots.d/whitelist-ips.conf;
|
||||
|
||||
# ***********
|
||||
# Google Bots
|
||||
|
|
22
robots.txt/LICENSE.md
Executable file
22
robots.txt/LICENSE.md
Executable file
|
@ -0,0 +1,22 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2017 Mitchell Krog - mitchellkrog@gmail.com
|
||||
https://github.com/mitchellkrogza
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
Loading…
Add table
Reference in a new issue