Forum Discussion
Milan_4483
Mar 16, 2011Nimbostratus
irule: http to https for a specific host
Hello, I have the following issue and need a way to redirect a specific host. Issue: User types https://www.xyz.com/abc in the browser, request hits F5 which decrypts and forwa...
Milan_4483
Mar 16, 2011Nimbostratus
I have the following rule but it does not interpret $host variable
when HTTP_RESPONSE {
set host [string tolower [HTTP::host]]
Check if server response is a redirect
if { [HTTP::status] == "302"} {
Check if path in Location header set to lower case contains /uri1 or /uri2
switch -glob [string tolower [URI::host [HTTP::header value Location]]] {
$host
{
Do the update, replacing http:// with https://
HTTP::header replace Location [string map -nocase "http:// https://" [HTTP::header value Location]]
}
}
}
}
If i hardcode the $host variable in the switch statement, it works. Not able to figure out why.
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