apache禁用不安全的http法_java-在Apache服务器上禁用OPTIONS HTTP

Request:

OPTIONS / HTTP/1.1

Host: webcat.staci.com

Connection: Keep-alive

Accept-Encoding: gzip,deflate

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.21

Accept: */*

Response:

HTTP/1.1 200 OK

Date: Thu, 01 Oct 2015 12:24:59 GMT

Server: Apache

X-Frame-Options: SAMEORIGIN

Allow: GET,HEAD,POST,OPTIONS,TRACE

Vary: Accept-Encoding,User-Agent

Content-Length: 0

Keep-Alive: timeout=7, max=95

Connection: Keep-Alive

Content-Type: httpd/unix-directory

Set-Cookie: BIGipServerwebcat-ssl=192938503.47873.0000; path=/; httponly; secure

我想在我的Apache服务器上禁用HTTP OPTIONS,但我想保留GET,POST,并且我要PING我的服务器.

我该怎么办?

我的httpd.conf:

RewriteEngine On

RewriteCond %{REQUEST_METHOD} !^ (GET,POST,HEAD)

RewriteRule .* – [R=405,L]

解决方法:

使用RewriteCond不能禁用OPTIONS方法.

您必须使用LimitExcept指令禁用它.

以下是可在Apache配置之外添加的代码段:

order deny,allow

deny from all

请不要忘记重新启动Web服务器:)

标签:jboss,apache,java

来源: https://codeday.me/bug/20191027/1943454.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值