Forum Discussion
teguh_wilidarma
Feb 07, 2011Nimbostratus
iRule HTTP redirection - one server multiple instance
Hi, I was digging through this forum and found several similar cases like mine, but I am still very newbie on how iRule commands interact with VS and pool member selection. Moreover, I havent managed ...
teguh_wilidarma
Feb 08, 2011Nimbostratus
Posted By hoolio on 02/08/2011 08:03 AM
Hi Sven,
You could use a switch statement. It shouldn't make a big difference, but it's a bit cleaner:
when HTTP_REQUEST {
switch [HTTP::host] {
"front_web" {
if { [string tolower [HHTP::uri]] starts_with "/servlet/livegiverservlet" } {
pool poolname_2025
} else {
pool poolname_2020
}
}
"tr_web" {
if { [string tolower [HHTP::uri]] starts_with "/servlet/livegiverservlet" } {
pool poolname_4025
} else {
pool poolname_4020
}
}
}
}
Aaron
Hi hoolio, what is the difference between "switch" and "if" command? My ref is only the conf guide for LTM and I found no switch command in it. also, the string tolower? could you help explain a quick brief of these commands?
One more question hoolio, if the user is accessing through port 80, and then we state in the vs settings that the vs port is 80, but in the pool member in that vs is (some_IP):2020, would LTM change the destination port into 2020 or it stays in 80?
@Stefan, they say it will be dropped. The client program in the user's PC will only generate that particular URI with https.
Thanks
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