安装在同一服务器节点上的Apache和JBoss应用程序的Apache proxypass配置

时间:2017-12-04 13:57:03

标签: apache proxypass

如果我点击 - http://10.157.128.170/oneapp应用程序应该从Apache内容加载index.html

所有 API调用,例如http://10.157.128.170:25003/oneapp/ *(其中*可能是任何API调用)应该将调用重定向到端口上的JBOSS:25003 / oneapp

此要求的Apache配置是什么?

我目前的配置是:

ProxyPassMatch      ^/oneapp/$            !
ProxyPass            /oneapp/index.html   !
ProxyPass            /oneapp              http://10.157.128.170:25003/oneapp
ProxyPassReverse     /oneapp              http://10.157.128.170:25003/oneapp

我需要点击:http://10.157.128.170/index.html才能转到index.html,但我需要http://10.157.128.170/oneapp

文件我在Apache Content目录

index.html
app.css
app.js
images

1 个答案:

答案 0 :(得分:0)

只需添加尾部斜杠即可解决问题

ProxyPassMatch      ^/oneapp/$            !
ProxyPass            /oneapp/index.html   !
ProxyPass /oneapp/ http://10.157.128.170:25003/oneapp/
ProxyPassReverse /oneapp/ http://10.157.128.170:25003/oneapp/

还要确保启用了mod_proxy和mod_proxy_http。

相关问题