0
我想重定向一些请求到另一台服务器。对http://host:port/dir的每个请求都应重定向到http://anotherhost:port/dir。 我已经尝试使用ProxyPass/ProxyPassReverse,RewriteCond/RewriteRule等,但没有解决。Apache重定向主机:端口/目录到另一个主机:端口/目录
有人可以帮我吗? 预先感谢您
问候
我想重定向一些请求到另一台服务器。对http://host:port/dir的每个请求都应重定向到http://anotherhost:port/dir。 我已经尝试使用ProxyPass/ProxyPassReverse,RewriteCond/RewriteRule等,但没有解决。Apache重定向主机:端口/目录到另一个主机:端口/目录
有人可以帮我吗? 预先感谢您
问候
解决了!第一件要做的就是听端口,例如:如果我们试图做的每一个请求都会被重定向到http://anotherhost:8080/dir,那么我们应该监听端口8080,因此,下一行必须在httpd.conf中。
Listen 8080
然后,我们需要配置代理:
ProxyRequests On
ProxyPass /dir http://anotherhost:8080/dir
ProxyPassReverse /dir http://anotherhost:8080/dir
我希望这能帮助别人
问候