提问者:小点点

没有出现上下文名称的Apache代理子域根请求


我面临着一个荒谬的困难来执行 /context /root使用ReverseProxy Apacher WebServer和Tomcat之间。

解释我的场景:子域:app01.domain.comapp02.domain.com

雄猫:

http://localhost:8080/app01

http://localhost:8080/app02

我希望在访问子域时,用户看不到上下文的名称。在我的apache中,我有以下配置:

ProxyPass /app01/http://localhost:8080/app01/重试=0

ProxyPassReverse /app01/http://localhost:8080/app01/

ProxyPass/http://localhost:8080/app01/重试=0

ProxyPassReverse/http://localhost:8080/app01/

ProxyPass/http://localhost:8080/重试=0

ProxyPassReverse/http://localhost:8080/

这是因为访问应用程序不需要键入上下文的名称。但是,当访问“app01.domain.com”时,它会在“app01.domain.com/app01”末尾插入上下文名称。

我真的希望在没有出现上下文名称的情况下访问它。


共1个答案

匿名用户

我用简单的方法解决了这个问题!

重写规则 ^/(.*)$ http://localhost:8083/app01/1美元[P]

ProxyPassReverse/http://localhost:8083/app01/

ProxyPassReverseCookiePath /app02/