Forum Discussion
IheartF5_45022
Apr 02, 2014Nacreous
I'd probably leave it the same except for the pool definitions
pl_abc_http members {2.2.2.2:80}
pl_def_http members {2.2.2.3:80}
pl_ghi_http members {2.2.2.4:80}
Slight tweak to iRule to show you some other things you might want to do;-
when HTTP_REQUEST {
set path_seg1 [lindex [split [HTTP::path] / ] 1 ]
switch $path_seg1 {
"abc" -
"def" -
"ghi" {
Rewrite Host header
HTTP::header replace Host "${path_seg1}.com"
Rewrite path to remove first segment (not sure if this is actually your requirement)
if {[substr [HTTP::path] 4 ] starts_with "/"} {
HTTP::path [substr [HTTP::path] 4 ]
} else {
HTTP::path "/"
}
pool "pl_{$path_seg1}_http"
}
default {
Return 404 for not found path
HTTP::respond 404 noserver content {404 - Page Not FoundWe're sorry - the page you are looking for cannot be found}
return
}
}
}