2014-01-09 47 views
1

在apache虛擬主機中,我試圖將/db重定向到存在的數據庫。這只是暫時的工作,它顯示了現有的歡迎屏幕,但隨後存在重定向到儀表板,並找不到該頁面。如何正確地將url重定向到存在db端口

ProxyPreserveHost On 
ProxyRequests Off 
ProxyPass /db http:**localhost:8899 
ProxyPassReverse /db http:**localhost:8899 

我想設置的東西,所以我可以做REST查詢,如/db/rest

我在做什麼錯?

感謝

回答

2

你需要做一些URL重寫和cookie處理:下面的示例圖「/」和「myapp2」。也可以映射到/ rest/db/myapp1。

<VirtualHost *:80> 
     ProxyRequests  off 
     ServerName  myserver 

     ProxyPass   /myapp2/ http://localhost:8080/exist/apps/myapp2/ 
     ProxyPassReverse /myapp2/ http://localhost:8080/exist/apps/myapp2/ 

     ProxyPass  /http://localhost:8080/exist/apps/myapp1/ 
     ProxyPassReverse/http://localhost:8080/exist/apps/myapp1/ 

     ProxyPassReverseCookieDomain localhost myserver 
     ProxyPassReverseCookiePath /  /exist 

     RewriteEngine  on 
     RewriteRule   ^/(.*)$  /$1 [PT] 
</VirtualHost> 
+0

謝謝你的提示!在我的情況下有趣的是'ProxyPassReverseCookiePath//存在'不起作用,但'ProxyPassReverseCookiePath /存在/'工作!但是,通過這種配置,我無法通過** REST **訪問,應用程序的其他部分運行良好。 –

相關問題