Forum Discussion
raytoles_75680
Nimbostratus
Dec 03, 2009Header Insert of "http" or "https"
We're going to implement a virtual server to handle HTTP and HTTPS requests. The developers need us to insert the protocol into the header. We're still new to irules and I constantly fear performanc...
hoolio
Cirrostratus
Dec 07, 2009It would be more efficient to only check for the Location header on redirects. Also, if you want to preserve the URI in the redirect, you should use string map:
when HTTP_RESPONSE {
if { [HTTP::is_redirect] and [HTTP::header Location] starts_with "http://newsite.apa.org:443"} {
log local0. "Location [HTTP::header Location]"
HTTP::header replace Location "[string map "http://newsite.apa.org:443 http://newsite.apa.org" [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