如何在Apache中使用RewriteEngine在一个端口上代理不同的服务器而不更改每个服务器的基本URL

Apache中是否可以通过反向代理传递经过修改的url?

示例:

我在不同的端口上有几台服务器

ProxyPass "/serv8888"  "http://localhost:8888"
ProxyPassReverse "/serv8888"  "http://localhost:8888"

ProxyPass "/"  "http://localhost:80"
ProxyPassReverse "/"  "http://localhost:80"

但是当我连接到http://localhost/serv8888时,它会在内部重定向到http://localhost:80/tree,并且由于我需要获取http://localhost/serv8888/tree(即http://localhost:8888/tree)而无法正常工作

我试图在网上搜索很多,但是没有找到答案。为了使我的问题更清楚,这里是almost the same question

如何使用RewriteEngine即时更改URL?

qingzhihanbing 回答:如何在Apache中使用RewriteEngine在一个端口上代理不同的服务器而不更改每个服务器的基本URL

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3104474.html

大家都在问