Forum Discussion
Patrick_Stiever
Sep 09, 2011Nimbostratus
iRules amatuer What does this iRule do?
Hello all,
I do not have much experience with iRules, and I am hoping some here can give me an idea what this iRule is doing:
when HTTP_REQUEST {
if { [HTTP::uri] starts_...
hooleylist
Sep 12, 2011Cirrostratus
Here's an updated version which uses a switch statement to check the URI and corrects the datagroup reference:
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/onlineserv/HB" -
"/beta/HB*" -
"/preprod/HB*" {
Lookup the host based on the HTTP host header
log local0. "host = '[HTTP::host]'"
Check if the host header exists and isn't an IP
if {[string match -nocase {*[a-z]*} [HTTP::host]]}{
set ibHost [class lookup [HTTP::host] USP_IB_REDIRECT_DG]
if { $ibHost != "" } {
log local0. "ibHost found: '$ibHost'"
node $ibHost
} else {
log local0. "ibHost not found"
HTTP::respond 404
}
} else {
SSL::disable serverside
}
}
default {
Default action is to use the VS default pool for non-matching URIs
}
}
}
Aaron
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