Forum Discussion
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 to external world. We don’t have the flexibility to change the code to do ‘relative’ URL redirect.
when HTTP_REQUEST {
set host [HTTP::header host]
if { [matchclass [HTTP::uri] contains $::A_URIs_no_persist] } {
persist none
pool Pool_A
event disable
}
}
when HTTP_RESPONSE {
STREAM::disable
if {[HTTP::status] ==200 and [HTTP::header value Content-Type] contains $::A_URIs_no_persist }{
STREAM::expression @http://A8001:8001/@http://$host/@
STREAM::enable
}
}
I have setup this iRule but it still replies with A8001:8001
Any suggestions?
- hoolio
Cirrostratus
That looks like a good start. Can you replace this portion with matchclass to check the Content-Type header against the datagroup?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 } }
- Marc_Steiniger_
Nimbostratus
when HTTP_REQUEST { - hoolio
Cirrostratus
Hi Marc, - thanks guys i got it working.
- hoolio
Cirrostratus
The regex could be fairly simple: - yeah i removed the event disable.
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