Forum Discussion
DAGOATMAMBA_328
Nimbostratus
Aug 04, 2017Auto redirect http to https for LB traffic
For traffic routing to the new LB solution, if there is no matching host on the HTTP endpoint, return a redirect to the client for them to try the same request on the HTTPS endpoint.....this is for a...
Hectorm
Nimbostratus
Aug 07, 2017when 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 }
www.testpool.org { 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
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