Forum Discussion
Ryan_Kiste_7775
Nimbostratus
Jun 01, 2009Dynamic Pool redirection
I am attempting to create a dynamic irule that redirects based on the users HTTP::host. Below is a static implementation of my requirements.
when HTTP_REQUEST {
switch [HTTP::host] {
...
The stream filter and iRule should have fairly low overhead as LTM isn't having to buffer the full payloads to do the rewriting like it would if you used HTTP::collect/HTTP::payload to rewrite the response content. You could make the iRule even more efficient by further limiting when you enable the stream filter. If the http:// reference is only sent in response content for specific response content-types, you could make the 'if {[HTTP::header value Content-Type] contains "text"' check more exact like 'if {[HTTP::header value Content-Type] starts_with "text/javascript"'. Or if the http:// reference is only sent in replies to a specific URI, you could add a check in HTTP_REQUEST based on the requested URI and only enable the stream filter in HTTP_RESPONSE for that URI.
It would be most efficient to avoid using the iRule altogether by updating the application to either use https:// in absolute references or to use relative URIs (without the protocol and host name) if possible.
Aaron