Forum Discussion
networkingman_3
Jan 15, 2018Nimbostratus
URL based load balancing. How?
Hi,
We are kinda new to F5 and iRules so we don't really know how to create url based load balancing and we are not good at writing iRules. :)
What we want to do is that we have different ...
RossVermette
Jan 16, 2018Nimbostratus
Here's an iRule I use for this type of thing. It uses a "Datagroup" that you can update the http host header to pool mapping to do what you want.
-
Create a Datagroup "HOST_2_POOL_DataGroup" with entries like:
"expample.com" := "APP_Pool01", "subdomain.example.com" := "APP_Pool02",
`
-
Here is the iRule "HTTP-Host-2-Pool-MAP"
`when HTTP_REQUEST { set pool_select_value [class lookup [string tolower [HTTP::host]] HOST_2_POOL_DataGroup] if {[active_members $pool_select_value] > 0 } { log local0.notice "available pool members" pool $pool_select_value } else { HTTP::respond 503 content "No active pool members in pool" } }
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