Forum Discussion
Basic HTTP Stream Profile
The STREAM profile doesn't really work well with URLs. It works on the data in both directions, so basically you're saying replace any http:// references with https:// on the way in (Host headers usually), and again replace any http:// references with https:// on the way out (Location headers and payload object references). So assuming you only want to replace content in one direction, you necessarily need to do STREAM in an iRule. Apply an empty STREAM profile to the VIP and an iRule like this:
when HTTP_REQUEST {
tell server not to compress response
HTTP::header remove Accept-Encoding
disable STREAM for request flow
STREAM::disable
}
when HTTP_RESPONSE {
catch and replace redirect headers
if { [HTTP::header exists Location] } {
HTTP::header replace Location [string map {"http://" "https://"} [HTTP::header Location]]
}
only look at text data
if { [HTTP::header Content-Type] contains "text" } {
create a STREAM expression to replace any http:// with https://
STREAM::expression {@http://@https://@}
enable STREAM
STREAM::enable
}
}
This will only replace http:// with https:// on the way out (to the client). Presumably you have this applied to a port 443 VIP that is offloading SSL.
Recent Discussions
Related Content
* 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