Forum Discussion
Sunnypro_250536
May 15, 2017Nimbostratus
iRule for Load Balancing to Different Pools depending on the URI
Hello,
We need to have a Virtual Server to be configured on our LTM's which are running on the code version 10.2.4. we need to have two LTM ports configured that needs to load balance to 6 backe...
- 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.
Anesh
May 16, 2017Cirrostratus
- Below is an example use similar else if statements for the other pools and URI
-
Assign the iRule and not the pool
when HTTP_REQUEST { if { ([HTTP::uri] starts_with "/def/ghi/account") } { pool 8100 }elseif { [HTTP::uri] starts_with "/def/ghi/customer" } { pool 8200 }elseif { [HTTP::uri] starts_with "/def/ghi/equipment" } { pool 8300 } }
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects