Score:0

How to setup Apache load balancer for sub domains?

co flag

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?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.