【发布时间】:2016-06-27 07:52:37
【问题描述】:
我们在 Apache 2.2 (CentOS 6.latest) 和 Rails 3.2 之后使用 Passenger 4.0.59。
在 /etc/httpd/conf/httpd.conf 我们有:
TraceEnable off
我们在 httpd.conf 中配置了一个虚拟主机,在 /etc/httpd/conf.d/ssl.conf 中配置了第二个虚拟主机,它配置了Passenger。
我正在使用这种形式的命令进行测试:
curl -I -X {method} https://{host}/{resource}
...并看到以下行为:
当我通过 http 跟踪静态图像时,即http://host.domain.com/images/foo.png,我收到 405 响应(如预期的那样)。
当我通过 https 跟踪相同的静态图像时,这意味着它通过配置有乘客的虚拟主机,我得到 405(如预期的那样)。
但是,当我在我们的应用程序中跟踪 Rails 服务时,例如https://host.domain.com/status.json,我收到了 200 条有效数据的响应。
我希望 Apache 会在请求到达Passenger/Rails 之前关闭请求并返回 405 响应,但这并没有发生。
我错过了什么/误解了什么?
【问题讨论】:
-
在阅读this thread 之后,您能否在
/etc/apache下grep 所有Apache 配置以确保没有其他TraceEnable选项可以将其设置为on?例如。在security.conf?如果没有,您能否发布更多相关的 http 配置部分,包括您的两个虚拟服务器?
标签: ruby-on-rails apache passenger httpd.conf phusion