Forum Discussion
Kevin_Davies_40
Nacreous
Aug 19, 2011HTTPS VIP for HTTP Website
Given there are many ways to skin a cat. If you were setting up a https VIP for a http webserver how would you do it? Currently it seems you have to add a stream profile with an iRule to rewrite http ...
hoolio
Cirrostratus
Aug 19, 2011If you have the option of modifying the application, you could make the absolute URLs relative. This avoids the need to do any payload rewriting and will work for HTTP or HTTPS. If not, I'd probably skip proxypass and just use a stream profile and iRule for this.
Here's one recent example:
http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/aff/5/afv/topic/aft/1179185/afc/1250734/Default.aspx
when HTTP_REQUEST {
Save the requested host value
set host [string tolower [HTTP::host]]
Disable the stream filter by default
STREAM::disable
}
when HTTP_RESPONSE {
Check if response type is text and host isn't null
if {[HTTP::header value Content-Type] contains "text" and $host ne ""}{
Replace http://$host with https://$host
STREAM::expression "@http://$host@https://$host@"
Enable the stream filter for this response only
STREAM::enable
if { [HTTP::is_redirect] } {
HTTP::respond 302 Location [string map -nocase "http://$host https://$host" [HTTP::header Location]]
}
}
Aaron
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