I forgot to post the code
I'm using this
http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&view=topic&postid=1871318767
With a little change
when HTTP_RESPONSE {
if { not ([matchclass [IP::client_addr] equals $::internal_net])}{
set content_length 1000000
HTTP::collect $content_length
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]]
}
}
}