【发布时间】:2020-11-03 10:39:55
【问题描述】:
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]
【问题讨论】:
-
到目前为止你尝试过什么?将
Disable OPTIONS HTTP on Apache Server放入 Google 会返回顶部 sureshk37.wordpress.com/2014/10/01/…。 -
亲爱的先生们,如果您投反对票,请至少给我一个小评论,我的答案可以如何改进。
-
您是否点击了我发布的链接?您会发现 Stefano 发布的相同解决方案。似乎答案并没有隐藏在互联网上。 ;-)
-
@SubOptimal 我点击链接,但他没有谈论
ping -
也许添加更多信息,你尝试了什么,你期望什么以及你得到什么。
you want to PING your server是什么意思?ping your.server.ip之类的东西?