2016-10-04 332 views
0

我試過這個問題的答案。 How to merge multiple ProxyPass directives in Apache? 但是當我啓動Apache說,我得到一個錯誤ProxyPass|ProxyPassMatch can not have a path when defined in a location.ProxyPass | ProxyPassMatch在位置中定義時不能有路徑

我的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

同樣可以在您提到的問題中看到,當嵌套在<Location>子句下時,有必要刪除ProxyPassProxyPassReverse子句的第一個參數。

所以考慮改變你的配置是這樣的:

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> 

這應該很好地工作。