Forum Discussion
Marker_58065
Nimbostratus
Dec 15, 2010Append domain when needed and redirect to HTTPS
Here is the background - we have a couple of internal F5s with a bunch of applications that we are doing SSL offloading on. When users access these applications they don't have to type the FQDN becau...
Here's an example of the datagroup mapping:
Datagroup mapping the VS IP to hostname
class redirect_vs_to_host_class {
{
host 1.1.1.1 { "vs1.example.com" }
host 1.1.1.2 { "vs2.example.com" }
host 1.1.1.3 { "vs3.example.com" }
}
}
iRule which references the above datagroup
when HTTP_REQUEST {
Look up the VS IP in the IP to hostname datagroup
set match [class search -value redirect_vs_to_host_class equals [IP::local_addr]]
If a match was found redirect to the hostname from the class
if {$match ne ""}{
HTTP::redirect https://$match[HTTP::uri]
} else {
Take some default action?
HTTP::redirect https://[HTTP::host][HTTP::uri]"
}
}
Note that the datagroup would need to be manually updated anytime a VS or hostname changes.
Aaron
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