我将以下代码添加到我的 httpd.conf 以在两个应用程序服务器之间进行负载平衡
<VirtualHost www.mydomainx.com:80>
ProxyRequests off
ProxyPreserveHost Off
ServerName www.mydomainx.com
ServerAlias mydomainx.com
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /test balancer://mycluster stickysession=JSESSIONID|jsessionid
<Proxy balancer://mycluster>
# WebHead1
BalancerMember http://www1.mydomainx.com
# WebHead2
BalancerMember http://www2.mydomainx.com
Order Deny,Allow
Deny from none
Allow from all
ProxySet lbmethod=byrequests
</Proxy>
<Location /balancer-manager>
SetHandler balancer-manager
# I recommend locking this one down to your
# your office
Order deny,allow
Allow from all
</Location>
ProxyPass /balancer-manager !
ProxyPass / balancer://mycluster/
</VirtualHost>
每当我将 URL 输入到 Web 浏览器 www.mydomainx.com 时,它都会加载主页,然后如果我输入用户名和密码并单击提交,它就会重新加载(http://www1.mydomainx.com / http ://www2.mydomainx.com)再次重新加载主页并强迫我重新输入用户名和密码,有没有办法阻止这一切?