Forum Discussion
rflon2015_23576
Nimbostratus
Feb 11, 2016iRule to determine whether to server Custom or default maintenance page
Hi all I am trying to get the following irule to work. Forgive me if it doesnt make sense as this is all new to me.
Ideally it should check whether a custom ifile should be served if it exists othe...
Kai_Wilke
MVP
Feb 12, 2016Hi Rflon2015,
to implement an additional error handle, for the case that the data-group entry already exist, but the iFile can somehow not found, you may try the syntax below...
when HTTP_REQUEST {
set $myfile to the name of the desired iFile found in the data-group IIS_DG
ifile must match the name of the pool
set myfile [class match -value [string tolower [HTTP::host]] equals IIS_DG ]
log local0. "Maint iRule, MYFILE=$myfile"
if { $myfile ne "" } then {
if myfile is not NULL, a valid name:value has been found
server the desired iFile
if { [catch {
HTTP::respond 503 content [ifile get $myfile]
}]} then {
HTTP::respond 503 content [ifile get IIS_maint_txt]
}
} else {
a valid name:value has not been found
serve the default iFile
HTTP::respond 503 content [ifile get IIS_maint_txt]
}
}
Cheers, Kai
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
