Forum Discussion
LeonK_146224
Mar 04, 2014Nimbostratus
Maintenance to ifile irule doesnt work
Hi Guys,
I have a two sets of LTMs in datacenters (SEA and LHR). I need to setup a maintenance page in LHR datacenter to present a page when VIPs in SEA datacenters go down. I am pretty new to IRULEs...
JRahm
Mar 05, 2014Admin
iFiles have two places of configuration, adding the file itself to the system (System->File Management->iFile List) and then making it accessible to an iRule (Local Traffic->iRules->iFile List). If you only use one partition, you can don't need the folder reference on your iFile call. My iRule for serving up html pages (with css/js and images) looks like this:
when HTTP_REQUEST {
if { [active_members appPool1] == 0 } {
HTTP::respond 200 content [ifile get "mtce_html"] "Content-Type" "text/html"
}
switch $path {
"/css/mtce.css" {
HTTP::respond 200 content [ifile get "mtce_css"] "Content-Type" "text/css"
return
}
"/img/mtce.png" {
HTTP::respond 200 content [ifile get "mtce_img"] "Content-Type" "image/png"
return
}
"/js/mtce.js" {
HTTP::respond 200 content [ifile get "mtce_js"] "Content-Type" "text/javascript"
return
}
}
}
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