最近网站开始有一些奇怪的请求

出于安全考虑,决定只允许Get/Post请求。
在Nginx配置文件中添加任意一个即可:
#方法一
if ($request_method !~ ^(GET|POST)$ ){
return 403;
}
#方法二
if ($request_method !~* GET|POST) {
return 403;
}#快速响应Head请求
if ($request_method ~ ^(HEAD)$ ) {
return 200 "All OK";
}