apache、iis、nginx禁止post请求
admin
2019-08-27 PM
466℃
0条
apache
禁止非GET请求
RewriteEngine On
#RewriteCond %{REQUEST_METHOD} ^(POST|TRACE|OPTIONS)
RewriteCond %{REQUEST_METHOD} !(GET)
RewriteRule (.*) - [F]
#RewriteRule (.*) - [R=502,L]
iis
禁止非GET请求
<match url="(.*)" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_METHOD}" pattern="GET" ignoreCase="false" negate="true"/>
</conditions>
<action type="AbortRequest" />
</rule>
nginx
禁止非GET、HEAD请求
if ($request_method !~ ^(GET|HEAD)$) {
return 403;
}