I am learning how to setup a load balancer with Apache , following a guide I have it to this point for a test:
<proxy balancer://appset>
BalancerMember http://web-01.example.com
BalancerMember http://web-02.example.com
ProxySet lbmethod=bytraffic
</proxy>
ProxyPass "/app" "balancer://appset/"
ProxyPassReverse "/app" "balancer://appset/"
This works for a top level domain, but how would I make this also work for sub domains?
Say I have:
Example.com
Server1.example.com
Server2.example.com
Cdn.example.com
Something.example.com
I would want all of these domains to be load balanced, it doesn’t really matter if cdn goes to a different server to the main traffic as it uses a shared storage area.
I would essentially need the cdn sub domain in my example to point to cdn.web-01.example.com and cdn.web-02 so Apache vhost on the other side can route the traffic
Just not sure how to make all and any sub domains be load balanced. Would it make more sense to forward to an ip instead of domain in this case and allow the servers vhost to load the correct content?
So would it be better to have
BalancerMember HTTP://88.88.88.88
BalancerMember HTTP://99.99.99.99
How about using https here?