【发布时间】:2010-12-21 15:33:37
【问题描述】:
我有 Rails 应用程序,它们使用 ActiveResource 相互通信。我已设置 VHOST 以将每个 HTTP 请求重定向到 HTTPS。这是一个应用程序的 VHOST:
<VirtualHost *.80>
<Location />
Redirect permanent / https://my.app.com/
</Location>
</VirtualHost>
#http requests will forwarded here by the above Redirect
<VirtualHost *.443>
....
</VirtualHost>
当我通过浏览器访问时,这会重定向查找,但是当我通过 ActiveResource 发送 HTTP 请求时,它会返回错误:已永久移动。我知道在上述设置中可能会发生这种情况,但是如何应对这种情况并使 ActiveResource 工作,即使它向 HTTP 发送请求(应该转发到 HTTPS)?
谢谢,
伊姆兰
【问题讨论】:
标签: ruby-on-rails http redirect https activeresource