【问题标题】:Apache redirection of host:port/dir to anotherhost:port/dirApache 将 host:port/dir 重定向到 anotherhost:port/dir
【发布时间】:2015-03-13 18:39:08
【问题描述】:

我想将一些请求重定向到另一台服务器。对http://host:port/dir 的每个请求都应重定向到http://anotherhost:port/dir。 我已经尝试过使用 ProxyPass/ProxyPassReverse、RewriteCond/RewriteRule 等,但没有任何结果。

有人可以帮帮我吗? 提前谢谢你

问候

【问题讨论】:

    标签: apache url-redirection


    【解决方案1】:

    解决了!首先要做的是监听端口,例如:如果我们试图做的是将来自http://host:8080/dir的每个请求重定向到http://anotherhost:8080/dir,我们应该监听端口8080,所以,下一行必须在httpd.conf。

    Listen 8080
    

    然后,我们需要配置代理:

    ProxyRequests On
    
    ProxyPass /dir http://anotherhost:8080/dir
    ProxyPassReverse /dir http://anotherhost:8080/dir
    

    我希望这可以帮助某人

    问候

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-07-05
      • 2011-05-30
      • 2014-08-16
      • 1970-01-01
      • 2021-04-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多