deny 124.45.0.16
或IP段
deny 124.45.0.0/16
如下:
server
{
#limit_conn one 1;
limit_req zone=req_one burst=120;
listen 80;
server_name dashan.test.cn;
index index.html index.htm index.php;
root /home/wwwroot/dashan.letcx.cn/public;
deny 119.111.111.145;
deny 119.111.111.1/145;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
include other.conf;
#error_page 404 /404.html;
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
access_log /home/wwwlogs/dashan.test.cn.log;
}