禁用apache OPTIONS方法

使用apache的重写规则来禁用OPTIONS方法。方法如下:

 
在apache配置文件http.conf中添加以下代码:

LoadModule  rewrite_module  path/to/apache/modules/mod_rewrite.so
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS)
RewriteRule .* - [F]


参考文章:

http://www.techstacks.com/howto/disable-http-methods-in-apache.html

http://www.linuxquestions.org/questions/linux-security-4/disabling-head-options-http-methods-in-apache-webserver-763347/


你可能感兴趣的:(文章,配置文件)