Forum Discussion
Auto redirect http to https for LB traffic
when HTTP_REQUEST { create a variable and change it everything to lowercase set Vuri [ string tolower [HTTP::uri]] set Vheader [string tolower [HTTP::host]] assign a pool name to the variable set Poolname "pl_www.testpool.org_80" set Irulename "Irule_www.testpool.org_80" Checking if the pool has active pools memebers set Poolmember [active_members $Poolname ] set Poolmemberlist [ active_members -list $Poolname] If there are no active pool members send it to outservice splash page if {$Poolmember < 1} then { log local0.alert "ALERT-TEAM Pool $Poolname is down. This mean website site is down. IRULE=$Irulename"; HTTP::redirect "http://www.outservicepage.org."; } else { set list of host to match. if none of them match redirect to HTTPS switch $Vheader { testpool.org { pool $Poolname } { pool $Poolname }
default {HTTP::redirect "https://[HTTP::host][HTTP::uri]"}
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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