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 it tries to put SSL on it.
Is there any way to include an exception list like the one that we have for the internal_net?
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
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://@https://@
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]]
}
}
}