Forum Discussion
iRule for Load Balancing to Different Pools depending on the URI
- May 16, 2017
Heya,
You could use a policy for this but here is a quick iRule for you too (keep in mind you could also use a datagroup within the iRule).
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/def/ghi/account*" { pool servers_8100 } "/def/ghi/customer*" { pool servers_8200 } "/def/ghi/equipment*" { pool servers_8300 } "/def/ghi/order*" { pool servers_8400 } "/def/ghi/statement*" { pool servers_8500 } "/def/ghi/payment*" { pool servers_8600 } "/def/ghi/financials*" { pool servers_8700 } default { pool servers_default_pool } } }You could run the iRule/policy on both virtual servers (443/7443), just make sure any client/server ssl profiles are applied appropriately.
 
Heya,
You could use a policy for this but here is a quick iRule for you too (keep in mind you could also use a datagroup within the iRule).
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
    "/def/ghi/account*" {
        pool  servers_8100
    }
    "/def/ghi/customer*" {
        pool servers_8200
    }
    "/def/ghi/equipment*" {
        pool servers_8300
    }
    "/def/ghi/order*" {
        pool servers_8400
    }
    "/def/ghi/statement*" {
        pool servers_8500
    }
    "/def/ghi/payment*" {
        pool servers_8600
    }
    "/def/ghi/financials*" {
        pool servers_8700
    }
    default {
        pool servers_default_pool
    }
}
}
You could run the iRule/policy on both virtual servers (443/7443), just make sure any client/server ssl profiles are applied appropriately.
The above iRule is more optimized solution than mine, using a switch is better than elseif
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com