http{
......
white_black_list_conf conf/white.list zone=white:4m;
white_black_list_conf conf/black.list zone=black:4m;
......
server{
.......
}
.......
}
http{
......
white_black_list_conf conf/white.list zone=white1:4m;
white_black_list_conf conf/black.list zone=black1:4m;
white_list white1 on; #白名单 white1 在整个http{} 中都开启
black_list black1 on; #黑名单 black1 在整个http{} 中都开启
server{
.......
}
.......
}
http{
......
white_black_list_conf conf/white.list zone=white2:4m;
white_black_list_conf conf/black.list zone=black2:4m;
server{
.......
white_list white2 on; #白名单 white1 在整个server{} 中都开启
black_list black2 on; #黑名单 black1 在整个server{} 中都开启
.......
}
.......
}
http{
......
white_black_list_conf conf/white.list zone=white3:4m;
white_black_list_conf conf/black.list zone=black3:4m;
white_black_list_conf conf/black.list zone=black2:4m;
white_black_list_conf conf/white.list zone=white2:4m;
server{
.......
location /do {
........
white_list white3 on; #白名单 white3 在location /do{} 中开启
black_list black3 on; #黑名单 black3 在location /do{} 中开启
........
}
location /do1{
white_list white2 on; #白名单 white2 在整个server{} 中都开启
black_list black2 on; #黑名单 black2 在整个server{} 中都开启
}
.......
}
.......
}
4.http配置接口说明:
(1)配置配置接口
http{
.......
server{
......
location /sec_config{
sec_config on;
}
......
}
.......
}
{
"version": "nginx/1.3.0",
"code": "0",
"item": {
"conf_type": "white_black_list_conf",
"zone_name": "white",
"list_path": "/home/john/nginx/conf/white.list"
},
"item": {
"conf_type": "white_black_list_conf",
"zone_name": "black",
"list_path": "/home/john/nginx/conf/black.list"
},
"item": {
"conf_type": "white_black_list_conf",
"zone_name": "ex",
"list_path": "/home/john/nginx/conf/status_ex"
}
}
2.2.2.2 192.168.141.1 3.3.3.3 4.4.4.5 2.3.4.4
"
if (rc == NGX_BUSY) {
ngx_log_error(lrcf->limit_log_level, r->connection->log, 0,
"limiting requests, excess: %ui.ui by zone \"%V\"",
excess / 1000, excess % 1000,
&limit->shm_zone->shm.name);
"
ngx_black_add_item_interface(r, 1);
http{
....
white_black_list_conf conf/black.list zone=black:4m;
limit_req_zone $binary_remote_addr zone=one:8m rate=4r/s;
...
server {
location / {
black_list black on;
limit_req zone=one burst=6;
dyn_black black 60; //禁止访问60秒,60秒后自动解除
...
}
location /xxx {
sec_config on;
}
...
}
...
}
lua_package_path "/usr/local/nginx/conf/waf/?.lua"; lua_shared_dict limit 10m; init_by_lua_file /usr/local/nginx/conf/waf/init.lua; access_by_lua_file /usr/local/nginx/conf/waf/waf.lua;
RulePath = "/usr/local/nginx/conf/waf/wafconf/"
curl http://xxxx/test.php?id=../etc/passwd
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有