我在这个问题上尝试了答案。
How to merge multiple ProxyPass directives in Apache?
但是当我开始apache说ProxyPass|ProxyPassMatch can not have a path when defined in a location.
我的000-default.conf下面是代码
<VirtualHost *:80>
include location1.conf
include location2.conf
</VirtualHost>
和我的location1有,
<Location /web/?_escaped_fragment_=/>
ProxyPass /phpmyadmin !
ProxyPass / http://localhost:8082/
ProxyPassReverse / http://localhost:8082/
</Location>
和我的location2有,
<Location /web/#!/>
ProxyPass /phpmyadmin !
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
</Location>
答案 0 :(得分:1)
与您提到的问题中可以看到的类似,当嵌套在ProxyPass
子句下时,有必要删除ProxyPassReverse
和<Location>
子句的第一个参数/强>
因此,请考虑改变您的配置:
<强> LOCATION1 强>:
<Location /web/?_escaped_fragment_=/>
ProxyPass /phpmyadmin !
ProxyPass http://localhost:8082/ # <== Dropped '/'
ProxyPassReverse http://localhost:8082/ # <== Dropped '/'
</Location>
<强> LOCATION2 强>:
<Location /web/#!/>
ProxyPass /phpmyadmin !
ProxyPass http://localhost:8080/ # <== Dropped '/'
ProxyPassReverse http://localhost:8080/ # <== Dropped '/'
</Location>
这应该可以正常工作。