在nginx.conf中配置相应的字段名
$http_user_agent
cat rqs_filter.conf
if ($http_user_agent ~* "lee_ypp" ) {
return 403;
}
(当请求头中包含lee_ypp的时候直接响应403返回码,不在逻辑层进行处理)
在具体的域名nginx配置的server字段下,include该rqs_filter.conf即可
在nginx.conf中配置相应的字段名
$http_user_agent
cat rqs_filter.conf
if ($http_user_agent ~* "lee_ypp" ) {
return 403;
}
(当请求头中包含lee_ypp的时候直接响应403返回码,不在逻辑层进行处理)
在具体的域名nginx配置的server字段下,include该rqs_filter.conf即可
转载于:https://my.oschina.net/leeypp1/blog/1580551