"> ');
本站使用了 Pjax 等基于 JavaScript 的开发技术,但您的浏览器已禁用 JavaScript,请开启 JavaScript 以保证网站正常显示!

服务器防止DDOS 分享人nginx安全规则

能有效防止70%攻击。

if ($request_uri ~* "(\.gz)|(\")|(\.tar)|(admin)|(\.zip)|(\.sql)|(\.asp)|(\.rar)|(function)|($_GET)|(eval)|(\?php)|(config)|(\')|(\.bak)") {
  return 301 http://lg-dene.fdcservers.net/10GBtest.zip;

}
非常感谢大佬的分享
我再补充几条
换迎大家持续补充

if ($request_uri ~* "(\.gz)|(\")|(\.tar)|(admin)|(\.zip)|(\.sql)|(\.asp)|(\.rar)|(function)|($_GET)|(eval)|(\?php)|(config)|(\')|(\.bak)") {
  return 301 http://lg-dene.fdcservers.net/10GBtest.zip;

}

禁止下载以 XXX 后缀的文件

location ~ .(zip|rar|sql|bak|gz|7z)$
{

return 444;

}

访问链接里含有 test 直接跳转到公安网

if ($request_uri ~* test=) {
return 301 https://www.mps.gov.cn;
}

#我来加一条  防止SB爬虫。

if ($http_user_agent ~* (SemrushBot|python|MJ12bot|AhrefsBot|AhrefsBot|hubspot|opensiteexplorer|leiki|webmeup)) {

  return 444;
}

正在加载...

推广

 继续浏览关于 的文章

 本文最后更新于:2022/07/10 20:02:48,可能因经年累月而与现状有所差异

 引用转载请注明:龙氏小哥 > 搬砖笔记 > 服务器防止DDOS 分享人nginx安全规则

发现共鸣


Warning: curl_setopt() expects parameter 1 to be resource, null given in /www/wwwroot/blog.longshi.org/usr/themes/armx/functions.php on line 1531
如是说:闻道者,朝生夕死,足尔;寻道者,忘生之死,憾尔。

发表评论

'); pageInit(); NProgress.done(); var url = window.location.href; if(url.indexOf("comment")>-1 ){ $('html,body').animate({scrollTop: $('#comments').offset().top /*+ Ch*/ }, 500); } if(typeof Blazy != 'undefined' && Blazy instanceof Function){ $(document).ready(function(){ var blazy = new Blazy(); }); } } }); InstantClick.on('wait', function(){ //点击链接但未加载 NProgress.start(); NProgress.inc(); }); // InstantClick.on('receive',function(url){ //页面已预加载 // url // body // title // }); // InstantClick.on('fetch',function(url){ //页面开始预加载 // }); InstantClick.init('mousedown'); } pageInit();