禁用apache OPTIONS方法

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

        使用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/

转载于:https://my.oschina.net/maliang0130/blog/338725

你可能感兴趣的:(禁用apache OPTIONS方法)