Forum Discussion
Kareem
Nimbostratus
Mar 06, 2014Is it possible to attach an irule to an HTTPS virtual server ?
Hi,
I am trying to combine two irules together and having no luck. Can someone help ? The details are as follows:
One rule is for http to https redirect while the second irule is for fallback page ...
Cory_50405
Noctilucent
Mar 06, 2014Yes. Leave your HTTP to HTTPS redirect iRule on your port 80 virtual server. Then this can be your iRule for your 443 virtual server:
when RULE_INIT {
set static::maint_page "Sorry! This site is down for maintenance."
}
when HTTP_REQUEST {
set maint_prefix "/maintenance.html"
if { [HTTP::uri] equals "$maint_prefix" } {
HTTP::respond 200 content $static::maint_page "Content-Type" "text/html" "Connection" "Close"
return
}
if { [active_members [LB::server pool]] < 1 } {
HTTP::redirect $maint_prefix
}
}
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