Dec 07, 2009
Stream iRule Help
I want this iRULE to modify the returned URL based on HTTP request.
Problem: A8001 is the local server name. It changes from server to server. We don’t want to expose local server name ...
Also, can you clarify what Content-Types you want to check in the response? The Content-Type header will contain MIME types--not URIs. So you should probably change this iRule to reference a new class which contains the Content-Types you want to check.
[HTTP::header value Content-Type] contains $::A_URIs_no_persist
[matchclass [HTTP::header value Content-Type] contains $::mime_types_to_check]
when HTTP_REQUEST {
set host [HTTP::host]
if { [matchclass [HTTP::uri] contains $::A_URIs_no_persist] } {
persist none
pool Pool_A
}
}
when HTTP_RESPONSE {
STREAM::disable
if {[HTTP::status] == 200 and [matchclass [HTTP::header value Content-Type] contains $::mime_types_to_check]}{
STREAM::expression @http://A8001:8001/@http://$host/@
STREAM::enable
}
}
Aaron