Forum Discussion
Gerardo_Garcia_
Nimbostratus
May 22, 2008Convert refrences inside the page to https
I need to convert the text that we are going to send back to the external users to be HTTPS for internal users I want http
My understanding is that we will need to change the payload to...
Gerardo_Garcia_
Nimbostratus
Jun 17, 2008I 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]]
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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