首页 > 其他 > 详细

vDDoS白名单、黑名单、获取真实访问者IP配置

时间:2021-02-28 00:13:31      阅读:24      评论:0      收藏:0      [点我收藏+]

一、白名单设置

修改配置文件 /vddos/conf.d/whitelist-botsearch.conf

#vi /vddos/conf.d/whitelist-botsearch.conf
#Alexa Bot IP Addresses
204.236.235.245; 75.101.186.145;
...

二、禁止某些IP访问

修改文件 /vddos/conf.d/blacklist-countrycode.conf

#vi /vddos/conf.d/blacklist-countrycode.conf
geoip_country /usr/share/GeoIP/GeoIP.dat;
map $geoip_country_code $allowed_country {
    default yes;
    US yes;
    CN no;#这个就是禁止中国IP访问
}
deny 1.1.1.1;

注意:默认配置文件自带禁止中国ip访问,因此这里得把原“CN no;”去掉,或修改成“CN yes;”yes就是允许的意思。

三、vDDoS 防御级别 reCaptcha模式使用

修改 recaptcha-secretkey.conf&recaptcha-sitekey.conf 两个配置文件

# nano /vddos/conf.d/recaptcha-sitekey.conf
# Website       reCaptcha-sitekey (View KEY in https://www.google.com/recaptcha/admin#list)
your-domain.com     6Lcr6QkUAAAAAxxxxxxxxxxxxxxxxxxxxxxxxxxx
...
#vi /vddos/conf.d/recaptcha-secretkey.conf
DEBUG=False
RE_SECRETS = { your-domain.com: 6Lcr6QkUAAAAxxxxxxxxxxxxxxxxxxxxxxxxxxx,
               your-domain.org: 6LcKngoUAAAAxxxxxxxxxxxxxxxxxxxxxxxxxxx }

Recaptcha获取:https://www.google.com/recaptcha/admin#list获取vDDoS的密钥

四、设置IP直接访问源站

修改文件 /vddos/conf.d/cdn-ip.conf

#vi /vddos/conf.d/cdn-ip.conf
# Cloudflare
set_real_ip_from 103.21.244.0/22;

vDDoS安装教程 https://www.cnblogs.com/shenjingwa/p/14457150.html

vDDoS白名单、黑名单、获取真实访问者IP配置

原文:https://www.cnblogs.com/shenjingwa/p/14457180.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!