Forum Discussion
Vincent_Power_9
Nimbostratus
Jun 07, 2005Rewriting a header inside RESPONSE_DATA
I have an application that uses its local server name when it builds a redirect URL during the authentication phase.
Example it sends back now
location: http://server1.atl.bluecr...
Vincent_Power_9
Nimbostratus
Jun 08, 2005The problem I am having trouble over coming is that I am trying to find a way to basically do the equivalent of "s/http:\/\/server.:8080/https:\/\/bigtest1/" on the location header of the outgoing data. The Apache ProxyPassReverse function handled this for me, and now I need to find a way to duplicate this functionality.
Is there a way in iRules to do a search and replace of a header?
The only way I've found to do it is listed below, but it sucks when Error.jsp has a dynamically generated QUERY_STRING.
when HTTP_RESPONSE {
if { [HTTP::header location] starts_with "http://server1:8080/app/Error.jsp" } {
HTTP::header replace location https://bigtest1/app/Error.jsp
} elseif { [HTTP::header location] starts_with "http://server2:8080/app/Error.jsp" } {
HTTP::header replace location https://bigtest1/app/Error.jsp
}
}
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
