Forum Discussion
pgsmith_120398
Altostratus
Apr 29, 2013Use dynamic variable derived from datagroup in irule
This is probably a very easy question...
We are testing using iRules to host multiple web server clusters beneath a single public IP using iRules. We have an iRule that looks at a datagroup and ...
nitass
Employee
Apr 29, 2013can you try this?
when HTTP_REQUEST {
get pool name
if { [class match -- [string tolower [HTTP::host]] eq /ESI/wild.erp-dg] } {
set hostvar [class search -value /ESI/wild.erp-dg eq [string tolower [HTTP::host]]]
}
check whether pool is down
if { [active_members $hostvar] < 1} {
switch [string tolower [HTTP::uri]] {
"/ufstyle.css" {
HTTP::respond 200 content [ifile get ufstyle.css] "Content-Type" "text/css"
}
"/myuflheaderborder.jpg" {
HTTP::respond 200 content [ifile get myuflheaderborder.jpg] "Content-Type" "image/jpeg"
}
"/myuflheader_bg.jpg" {
HTTP::respond 200 content [ifile get myuflheader_bg.jpg] "Content-Type" "image/jpeg"
}
"/myuflheader.gif" {
HTTP::respond 200 content [ifile get myuflheader.gif] "Content-Type" "image/jpeg"
}
"/myufllogo.gif" {
HTTP::respond 200 content [ifile get myufllogo.gif] "Content-Type" "image/jpeg"
}
"/uflwordmark.gif" {
HTTP::respond 200 content [ifile get uflwordmark.gif] "Content-Type" "image/jpeg"
}
default {
HTTP::respond 200 content [ifile get $hostvar] "Content-Type" "text/html"
}
}
send to pool if pool is not down
} else {
pool $hostvar
}
}
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