簡體   English   中英

使用mod_cluster在Apache HTTPD中重寫網址

[英]Url rewriting in Apache HTTPD with mod_cluster

我是Apache的新手。 我有2個jboss(Jboss為7.1.1)和apache httpd服務器。 我正在使用mod_cluster進行負載平衡。 我希望向用戶隱藏jboss網址,並希望向用戶顯示干凈的網址。

例如

www.mydomain.com將擁有我的靜態網站。
subdomain.mydomain.com應該轉到mydomain.com:8080/myapp
subdomain.mydomain.com/mypage.xhtml應該轉到mydomain.com:8080/myapp/mypage.xhtml
sumdomain.mydomain.com/myservice應該轉到mydomain.com:8080/myapp/service.xhtml?name=myservice

我嘗試了很多事情,但都沒有成功。 有人可以告訴我是否可行。 如果可能的話,我應該做什么。

非常感謝。

問候。

您不能做自己想做的事情的原因是因為您試圖同時解決兩個非常不同的問題。 分開將它們單獨解決。

負載均衡器:我通常使用Proxy作為負載均衡器。 例如

<Proxy balancer://mycluster>
BalancerMember http://wn1.seco.com
BalancerMember http://wn2.seco.com
</Proxy>
ProxyPass /test balancer://mycluster

重定向和轉發:使用mode_rewrite將特定的URL重定向到其他URL。

RewriteEngine  on
RewriteRule    "^/foo\.html$"  "/bar.html" [PT]

您可以使用mod_cluster,並且仍然可以控制ProxyPass指令。 例如, CreateBalancers 1 ,然后您可以自己創建代理ProxyPassMatch ^/static/ ! ProxyPass / balancer://qacluster stickysession=JSESSIONID|jsessionid nofailover=on ProxyPassReverse / balancer://qacluster ProxyPreserveHost on ProxyPassMatch ^/static/ ! ProxyPass / balancer://qacluster stickysession=JSESSIONID|jsessionid nofailover=on ProxyPassReverse / balancer://qacluster ProxyPreserveHost on 請參閱有關mod_cluster 1.3.1.Final的文檔

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM