![当入站请求 URL 是 HTTP 时,mod_rewrite [P]roxy 是否可以转换为 HTTPS URL?](https://linux22.com/image/650880/%E5%BD%93%E5%85%A5%E7%AB%99%E8%AF%B7%E6%B1%82%20URL%20%E6%98%AF%20HTTP%20%E6%97%B6%EF%BC%8Cmod_rewrite%20%5BP%5Droxy%20%E6%98%AF%E5%90%A6%E5%8F%AF%E4%BB%A5%E8%BD%AC%E6%8D%A2%E4%B8%BA%20HTTPS%20URL%EF%BC%9F.png)
我有一台主机(IIS6,运行由 Micronovae 公司为 Windows 开发的 mod_rewrite 程序。运行良好),其站点位于http://some.host.com
我还有另一台主机(在 Microsoft Azure 上),其网站位于https://secure.otherhost.com
目前我有一个 mod_rewrite 规则集,如下:
#visitor to some.host.com is transparently proxied to new site at secure.otherhost.com
ReWriteCond %{HTTP_HOST} some\.host\.com [NC]
ReWriteRule (.*) https://secure.otherhost.com$1 [P,L,QSA]
我知道这些规则有效(尽管我设置了日志记录选项,但这个该死的东西似乎没有记录到它应该记录的地方),因为如果我把它设为 [R] 规则而不是 [P] 规则,那么浏览器就会收到重定向并通过 HTTPS 顺利转到 secure.otherhost.com
但是,如果我启用 [P]roxy 模式,当我尝试访问时,只会收到 404 错误http://some.host.com
有人能给我一点提示吗?服务器可以与外部服务器进行 HTTPS 对话,然后通过 HTTP 将结果返回到我的客户端浏览器吗?