Forum Discussion
Gerardo_Garcia_
Jul 09, 2008Nimbostratus
Excluding some urls for the STREAM conversion
I have the following iRule that converts http to https for external users only as defined on the internal_net
However, when the page contains calls to google.com, amazon.com, ebay.com i...
Gerardo_Garcia_
Jul 24, 2008Nimbostratus
This is the iRule that I have, I just changed the name of the url to the one for the company.
This is the version BIG-IP 9.2.4 Build 13.1
when HTTP_RESPONSE {
if { not ([matchclass [IP::client_addr] equals $::internal_net])}{
Enable debug logging to /var/log/ltm? 1=yes, 0=no
set debug 1
STREAM::disable
If the response content type is text, configure the default stream profile to replace http:// with https://
if {[string tolower [HTTP::header value Content-Type]] contains "text"}{
STREAM::expression {@http://.*?example\.com@@}
STREAM::enable
}
Check if the response is a redirect (3xx)
if {[HTTP::is_redirect]}{
if {$debug}{log local0. "Original Location: [HTTP::header value Location], Updated Location: [string map {http: https:} [HTTP::header value Location]]"}
Use 'string map' to replace http: with https:
HTTP::header replace Location [string map {http: https:} [HTTP::header value Location]]
}
}
}
when STREAM_MATCHED {
log local0. "[IP::client_addr]:[TCP::local_port]: matched: [STREAM::match], replaced with: [string map {http:// https://} [STREAM::match]]"
STREAM::replace "[string map {http:// https://} [STREAM::match]]"
}
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