如何禁用 HTTP 的 DELETE PUT TRACE 方法
- Apache 在
httpd.conf添加如下配置:
apache
<Location "/">
AllowMethods GET POST
</Location>- Nginx 在
nginx.conf中进行如下设置:
nginx
if ($request_method !~ ^(GET|HEAD|POST)$ ) {
return 403;
}