【发布时间】:2015-03-13 18:39:08
【问题描述】:
我想将一些请求重定向到另一台服务器。对http://host:port/dir 的每个请求都应重定向到http://anotherhost:port/dir。 我已经尝试过使用 ProxyPass/ProxyPassReverse、RewriteCond/RewriteRule 等,但没有任何结果。
有人可以帮帮我吗? 提前谢谢你
问候
【问题讨论】:
我想将一些请求重定向到另一台服务器。对http://host:port/dir 的每个请求都应重定向到http://anotherhost:port/dir。 我已经尝试过使用 ProxyPass/ProxyPassReverse、RewriteCond/RewriteRule 等,但没有任何结果。
有人可以帮帮我吗? 提前谢谢你
问候
【问题讨论】:
解决了!首先要做的是监听端口,例如:如果我们试图做的是将来自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
我希望这可以帮助某人
问候
【讨论】: