1、打开nginx配置文件 cd /data/nginx/conf vim nginx.conf
2、修改nginx配置文件,如下图
在server下的location中增加if判断
if (requestmethod! (GET∣POST∣HEAD)request_method !~ ^(GET|POST|HEAD)requestmethod! (GET∣POST∣HEAD) ) {
return 400;
}
修改之后保存退出
重启nginx 进入cd /data/nginx/sbin下 命令:./nginx –s reload