Apache 2.2 ProxyPass 与 Weblogic - 无法使用 root
我正在尝试配置 Apache 2.2 代理服务器以指向多个 Weblogic 实例。除了一个小问题之外,我在所有事情上都做得很好。
我可以让它工作:ProxyPass /QA http://IP:PORT/
通过转到 http://IP:PORT/QA
但我无法让它工作:ProxyPass / http:// IP:PORT/
通过转到 http://IP:PORT/
我不明白为什么我不能将 ProxyPass 映射到根(/)
I'm trying to configure an Apache 2.2 proxy server to point to multiple Weblogic instances. I'm doing fairly well with everything but a minor point.
I can get this to work: ProxyPass /QA http://IP:PORT/
by going to http://IP:PORT/QA
But I can't get this to work: ProxyPass / http://IP:PORT/
by going to http://IP:PORT/
I don't understand why I cannot have ProxyPass map to the root(/)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信 Apache 不允许这样做。这里存在一个潜在的问题,即相互冲突的指令的顺序和优先级;如果您收到 /QA/ 的请求,应该跟在 /QA 匹配还是 / 匹配之后?我想您可能会尝试将多个托管服务器映射到同一地址/端口,而不必识别每个子路径,即单个规则而不是多个规则。与 documentRoot 仍然存在冲突。可以说,如果您在根上进行匹配,那么 Apache 层的意义是什么 - 所有内容都直接通过,并且 Apache 本身不提供任何服务。 (这并不意味着永远没有正当理由这样做,但我可以理解为什么 Apache 可能会这么想)。
我知道执行此操作的唯一方法是在虚拟虚拟主机内(不确定这是否可以在唯一的侦听端口上,但我认为可以):
您还可以查看 WebLogic 代理插件:
I believe Apache just doesn't allow it. There's a potential problem here with the order and precedence of conflicting directives; if you get a request for /QA/ should that follow the /QA match or the / match? I guess you might be trying to map multiple managed servers on the same address/port without having to identify each sub-path, i.e. a single rule instead of many. There's still a clash with documentRoot. Arguably, if you're matching on root, then what's the point of the Apache layer - everything is being passed straight through and nothing is being served by Apache itself. (Which doesn't mean there are never valid reasons to do that, but I can see why Apache might think it).
The only way I know to do this is inside a dummy virtual host (not sure if this can be on the only listen port, but I think so):
You could also look at the WebLogic proxy plug-in:
亚历克斯,谢谢你的帮助!
对于尝试设置类似环境的其他人,我已将我所做的内容粘贴在下面。
Alex, thanks for your help!
For anyone else out there trying to setup a similar environment, I've paste what I've done below.