Forum Discussion

cmeyer's avatar
cmeyer
Icon for Altostratus rankAltostratus
Jul 18, 2022

Can I load balance multiple subdomain URLs?

Hey everyone, I know basics on my iRule creation but am wondering if it's possible to load balance multiple URLs from the same subdomain.  I am currently load balancing page.domain.com with no problem.  I am also now wanting to load balance page.domain.com/apicall...Not sure if I am searching with the correct syntax or what I am trying to do is feasible.  Currently running BIG-IP v15.1.5.1.

Thanks in advance.

 

Chad 

5 Replies

  • Hi cmeyer,

    are you looking for Content Switching / URL based load balancing? In that case, this iRule should be a starting point: 

    when HTTP_REQUEST {
        switch -glob -- [string tolower [HTTP::path]] {
            "/path1*" {
                pool pool_app1
                return
            }
            "/path2*" {
                pool pool_app2
                return
            }
            default {
                pool pool_default
            }
        }
    }

     Is this helpful for you?

    KR
    Daniel

    • cmeyer's avatar
      cmeyer
      Icon for Altostratus rankAltostratus

      Daniel_Wolf In this case my pools would stay the same.  I am utilizing the same servers in each case.  Not sure if that matters.

      • If you have loadbalancing for page.domain.com, loadbalancing will also work for page.domain.com/subsite1, page.domain.com/subsite2, or anything else - since they are served by the same pool of servers as page.domain.com. In this scenario, there is no need for an additional iRule.
        Unless... I didn't get your setup right 🙂