如何禁用危險的http方法,如TRACE,OPTIONS
windows 2008-2012:
請在wwwroot目錄建立web.config,內容如下,如果文件已經存在,請添加紅色部分
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<security>
<requestFiltering>
<verbs allowUnlisted="true">
<add verb="OPTIONS" allowed="false"/>
<add verb="TRACE" allowed="false"/>
</verbs>
</requestFiltering>
</security>
</system.webServer>
</configuration>
windows 2003:
控制面板-ISAPI篩選器-啟用自定義重寫組件,然后編輯/others/discuz/httpd.conf 如果您已有其他規則,請添加到第一條規則
RewriteEngine on
RewriteCond %{THE_REQUEST} ^(TRACE|OPTIONS)
RewriteRule .* - [F]
linux:
在wwwroot目錄下創建.htaccess文件,內容如下,如果您已有其他規則,請添加到第一條規則
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(TRACE|OPTIONS)
RewriteRule .* - [F]
來源:西部數碼