Forum Discussion
pgsmith_120398
Altostratus
Apr 24, 2013Sorry Server iRule with iFiles
Hello,
I have been searching the forums, wiki, and web for more information about setting up an iRule that will utilize iFiles to deliver a sorry page using the HTTP::content command. I h...
pgsmith_120398
Altostratus
Apr 25, 2013I'm really not entirely sure why it wasn't working, however I finally got it working with the following code:
when HTTP_REQUEST {
if { [active_members [LB::server pool]] < 1} {
switch [string tolower [HTTP::uri]] {
"/" {
HTTP::respond 200 content [ifile get index.html] "Content-Type" "text/html"
}
"/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"
}
}
}
}
In my HTML file I removed the leading /images/ or /css/ so it just reads image.jpg or ufstyle.css. I then created ifiles with the exact same name that were used in the HTML file on the F5 and created irule files with the exact same names as the ifiles. After doing that it is all working as expected.
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