Forum Discussion
nested elseif unexpected behaviour
Got a better idea of what's going on. Here's my rule:
when HTTP_REQUEST {
log local0. "incoming URI = [HTTP::uri]"
if { [active_members INF-HEC-HTTP] < 1 } {
switch -glob [string tolower [HTTP::path]] {
"*.gif" -
"*.jpg" -
"*.css" {
HTTP::uri [string range [HTTP::uri] [string last / [HTTP::uri]] end]
}
default {
HTTP::uri /
}
}
pool QA-PH
} elseif { [class match [string tolower [HTTP::uri]] starts_with QA-HEC-ENT-URI] } {
log local0. "sending to INF-ENT-HTTP"
pool INF-ENT-HTTP
} elseif { [class match [string tolower [HTTP::uri]] starts_with QA-HEC-URI] } {
log local0. "sending to INF-HEC-DNNREDIRECT"
pool INF-HEC-DNNREDIRECT
} else {
log local0. "sending to INF-HEC-HTTP"
pool INF-HEC-HTTP
}
}
When I look in the log my second esleif is not redirecting to the correct pool. From logs: Rule /Common/INF-HEC-LB-URI-HTTP : incoming URI = /emp_banner/emp_logo/1546723432_City_In_The_Cloud.jpg Rule /Common/INF-HEC-LB-URI-HTTP : sending to INF-ENT-HTTP
emp_banner is included in QA-HEC-URI data group.
So the question then becomes: Is the second elseif being ignored because the first elseif changes something in the URI or do I not have the data group set right.
QA-HEC-URI data group: Type string /backoffice_newer /emp_banner/ /employer
Recent Discussions
Related Content
* 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