For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Mouene_240365's avatar
Mouene_240365
Icon for Nimbostratus rankNimbostratus
Aug 21, 2016

load balancing 4 servers

I have 4 web application servers and I am successfully load balancing between them , except I want F5 to load balance only between two of these servers once the URI become(for example): http://192.168.1.80/Arch/Enj

 

1 Reply

  • Pretty straight forward. Create two pools: one with all four and the other with the two specific ones. Assign the pool of 4 to the virtual server and employ an iRule something like this:

    when HTTP_REQUEST {
        if { [string to lower [HTTP::uri]] starts_with "/arch/enj" } {
            pool special_pool
        }
    }
    

    You could also use a switch:

    when HTTP_REQUEST {
        switch -glob [string to lower [HTTP::uri]] {
            "/arch/foo*" -
            "/arch/bar*" -
            "/arch/enj*" {
                pool special_pool
            }
        }
    }
    

    And depending on BIG-IP version you could also skip iRules and do all of this in CPM (LTM policies).