Forum Discussion
Eric_Frankenfie
Nov 07, 2016Nimbostratus
This is the iRule I created. Do you recommend using IF or CASE statements, or does it not matter?
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/n1" } {
HTTP::path "/myApp"
pool n1-app.example.com_443_pool
} elseif { [HTTP::uri] starts_with "/n2" } {
HTTP::path "/myApp"
pool n2-app.example.com_443_pool
} elseif { [HTTP::uri] starts_with "/n3" } {
HTTP::path "/myApp"
pool n3-app.example.com_443_pool
} elseif { [HTTP::uri] starts_with "/n4" } {
HTTP::path "/myApp"
pool n4-app.example.com_443_pool
} elseif { [HTTP::uri] starts_with "/n5" } {
HTTP::path "/myApp"
pool n5-app.example.com_443_pool
} elseif { [HTTP::uri] starts_with "/n6" } {
HTTP::path "/myApp"
pool n6-app.example.com_443_pool
} else {
pool app.example.com_443_pool
}
}