Hello,
I am trying to set up a load balancer in Apache 2.2.15 in the follwing configuration:
Code:
|- Node1
Client <--> Balancer <--> |- Node2
|- Node3
|- Node4
My balancer configuration in the Virtual Host configuration file is like this:
Code:
# ProxyRequests Off
# <Proxy *>
# Order Deny,Allow
# Deny from all
# </Proxy>
ProxyPass / balancer://sitea/
ProxyPassReverse / balancer://sitea/
#ProxyPreserveHost On
<Proxy balancer://sitea>
BalancerMember http://aas-poc-sitea-node1.emcpoc.local:80
BalancerMember http://aas-poc-sitea-node2.emcpoc.local:80
BalancerMember http://aas-poc-sitea-node3.emcpoc.local:80
BalancerMember http://aas-poc-sitea-node4.emcpoc.local:80
ProxySet stickysession=BALANCERID
</Proxy>
The problem I have is that the load balancer works but the balanced nodes (Node1-4) return a 301 Permanently Moved, the client browser then attempts to connect directly to the back-end node, which is not possible.
I understood that the ProxyPassReverse directive would prevent this. I have found that uncommenting the ProxyPreserveHost directive retains the correct URL but then the target page is not returned at all.
How can I force traffic to go through the balancer and prevent the client trying to follow the new URL in the 301 message?
Thanks,