【问题标题】:apache reverse proxy changes urlapache反向代理更改url
【发布时间】:2011-07-13 17:20:54
【问题描述】:

我尝试在服务器上配置 apache 的反向代理,将请求从 /hotm 重定向到 http://gateway.messenger.hotmail.com

在浏览器中输入地址xxx.xxx.xxx.xxx/hotm,请求重定向正确,但地址栏中的url变为“http://gateway.messenger.hotmail.com”。

可以在apache上配置代理,使地址不变?

[编辑] 这是 httpd.conf 片段

ProxyRequests Off
ProxyPass /hotm http://gateway.messenger.hotmail.com
ProxyPassReverse /hotm http://gateway.messenger.hotmail.com
<Directory /var/www/html/hotm>
 Order Allow,deny
 Allow from all
</Directory>
Redirect Permanent /hotm http://gateway.messenger.hotmail.com

【问题讨论】:

    标签: apache redirect reverse-proxy httpd.conf


    【解决方案1】:

    您还必须设置 ProxyPassReverse 指令,通常设置为与您的 ProxyPass 值相同的 url。

    【讨论】:

    • 我使用指令“ProxyPreserveHost On”,它可以工作。谢谢
    • 我也使用了ProxyPassReverseProxyPreserveHost On,但是得到了“重定向太多”。有没有人知道怎么解决?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-06
    • 1970-01-01
    • 1970-01-01
    • 2015-01-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多