Forum Discussion
Pael_74584
Nimbostratus
Mar 29, 2010iRule to intercept http redirection of server to client and convert to https
We are using Storefront as our webserver and we have an SSL Virtual Server. The webserver redirects the user to http://domain.com/URI1 or http://domain.com/URI2. This would then invalidate the SSL session because we don't have an HTTP server for the domain.com.
What variable should I look into to intercept the "http://domain.com/URI1" response of the webserver and re-write is as "https://domain.com/URI1"?
From my understanding, the iRules only apply to inbound traffic (coming from client). I have not implemented iRules outbound traffic (coming from server).
- hoolio
Cirrostratus
Hi Pael,when HTTP_RESPONSE { Check if server response is a redirect if { [HTTP::header is_redirect]} { Check if path in Location header set to lower case contains /uri1 or /uri2 switch -glob [string tolower [URI::path [HTTP::header Location]]] { "/uri1*" - "/uri2*" { Log original and updated values log local0. "Original Location header value: [HTTP::header value Location],\ updated: [string map -nocase "http:// https://" [HTTP::header value Location]]" Do the update, replacing http:// with https:// HTTP::header replace Location [string map -nocase "http:// https://" [HTTP::header value Location]] } } } }
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