Forum Discussion
Abed_AL-R_26070
Nimbostratus
Jul 12, 2018iRule URI matching issue
Hi
I'm trying to match first term but whatever I do it is not match
this iRule check the URI and sends the request to the appropriate pool
when HTTP_REQUEST {
if { [string tolower...
Lee_Sutcliffe
Nacreous
Jul 12, 2018Please try the following iRule, using a switch statement can avoid a lot of repetition (it is also faster than using if). As suggested above a policy may be an alternative. I have added logging to try to determine which conditions are being matched, please test and share the logging outputs, masking any sensitive information if necessary
when HTTP_REQUEST {
switch [string tolower [HTTP::path]] {
"/lmsserver" -
"/oauth" -
"/dtpcms" {
pool PLMS_Pool
log local0. "Path is [HTTP::path] selecting pool PLMS_Pool"
}
"/lms/sso" -
"/lms/rest/ext/oauth2/token" {
pool PLMS_Pool
HTTP::path "/lmsserver"
log local0. "setting Path to [HTTP::path] selecting pool PLMS_Pool"
}
"/httppush" {
pool Push_Pool
log local0. "Path is [HTTP::path] selecting pool Push_Pool"
}
"/admin" -
"/lms" {
pool PTEACH_Pool
log local0. "Path is [HTTP::path] selecting pool PTEACH_Pool"
}
"/rsp" -
"/dwh" {
pool PTDWH_Pool
log local0. "Path is [HTTP::path] selecting pool PTDWH_Pool"
}
"/" {
HTTP::redirect "http://[HTTP::host]/lms"
pool PTEACH_Pool
log local0. "Path is [HTTP::path] selecting pool PTEACH_Pool and sending redirect to http://[HTTP::host]/lms"
}
}
}
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