Forum Discussion
yuanqiang_22112
Nimbostratus
Aug 08, 2016irulse for http request
Hello everyone :
please help me check the irules , it is right ?
when HTTP_REQUEST {
if { [HTTP::host] equals "gp.study.teacheredu.cn" } {
pool gp_study_teacheredu
} elseif { [HTTP...
ekaleido
Cirrus
Aug 08, 2016
when HTTP_REQUEST {
if { [HTTP::host] equals "gp.study.teacheredu.cn" } {
pool gp_study_teacheredu
} elseif { [HTTP::uri] equals "http://study.teacheredu.cn/proj/proj/tlogin/hbGp?token=" } {
pool study_teacheredu_gpnl
} elseif { [HTTP::uri] equals "http://study.teacheredu.cn/proj/proj/tlogin/hbNl?token=" } {
pool study_teacheredu_gpnl
} else {
pool study_teacheredu
}
}
Maybe try it this way...
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "gp.study.teacheredu.cn" } {
pool gp_study_teacheredu
} else {
switch -glob [HTTP::uri] {
"/proj/proj/tlogin/hbGp?token=*" {
pool study_teacheredu_gpnl
}
"/proj/proj/tlogin/hbNl?token=*" {
pool study_teacheredu_gpnl
}
default {
pool study_teacheredu
}
}
}
}
- yuanqiang_22112Aug 08, 2016
Nimbostratus
@ekaleido,thank you I'll try it; my irules is wrong ?
- ekaleidoAug 08, 2016
Cirrus
I don't know that it was wrong, I just changed the HTTP::uri lines and changed to a switch instead of elsif to make it a little easier to read.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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