1 Star 0 Fork 0

foru / blockip

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
regex.txt 602 Bytes
Copy Edit Web IDE Raw Blame History
石榴木 authored 2020-02-03 10:08 . update
// 排除有效行
.*\s200\s(\d+\s)?.*\n
// 保留IP
\s\-\s\- .*
// NGINX屏蔽IP
((\d+\.){3}\d+)
deny $1\;
// 选中IP
(\d+\.){3}\d+
// C类
(\d+.\d+.\d+).0/24
// B类
(\d+.\d+).\d+.0/16
// 屏蔽后缀文件
[nginx]
location ~ \.(exe|bat|bak|com|sql|7z|cab|jar|tar|gz|iso|bz2|z)$ {
deny all;
}
location ~ ^/[\w_-]+\.(rar|zip)$ {
deny all;
}
location ~ uploadfile/(.*)\.(html|htm)$ {
deny all;
}
[apache]
<Files ~ "[\w_-]+\.(exe|bat|bak|com|sql|7z|cab|jar|tar|gz|iso|bz2|z)$">
Deny from all
</Files>
RewriteRule ^[\w_-]+\.(zip|rar)$ - [F]
RewriteRule uploadfile\/(.*).(html|htm)$ - [F]

Comment ( 0 )

Sign in for post a comment

1
https://gitee.com/sw1981/blockip.git
git@gitee.com:sw1981/blockip.git
sw1981
blockip
blockip
master

Search