Forum Discussion
BMARTIN_12200
Nimbostratus
Feb 17, 2009stream profile - set title browser
Hello, I created a rule to add information to the title field of the browser. His works on the first page of the portal, but when I open another application html from this portal, the title is not changed. Why?
Version:BIG-IP 9.3.1 Build 46.7
when HTTP_RESPONSE {
STREAM::disable
if { [HTTP::header value Content-Type] contains "text" }{
switch [IP::server_addr] {
"x.x.x.nn" { set nvip "thisname_nn" }
"x.x.x.uu" { set nvip "thisname_uu" }
default { set nvip [IP::server_addr] }
}
STREAM::expression "@<\[Tt\]\[Ii\]\[Tt\]\[Ll\]\[Ee\]>@$nvip @"
Active "stream profile"
STREAM::enable
}
}
when STREAM_MATCHED {
log local0. "<\[Tt\]\[Ii\]\[Tt\]\[Ll\]\[Ee\]>: matched: [STREAM::match], replaced with: $nvip "
}
5 Replies
- hoolio
Cirrostratus
Hi Bruno,when HTTP_REQUEST { If we're rewriting the response content, prevent the server from using compression in its response by removing the Accept-Encoding header from the request. LTM does not decompress response content before applying the stream filter. Ideally, we'd only remove it if we're rewriting response content. if { $::rewrite_response_payload } { if { [HTTP::header exists "Accept-Encoding"] } { Remove the Accept-Encoding header from the request HTTP::header remove "Accept-Encoding" } } }
- BMARTIN_12200
Nimbostratus
when HTTP_REQUEST { if { $::rewrite_response_payload } { if { [HTTP::header exists "Accept-Encoding"] } { Remove the Accept-Encoding header from the request HTTP::header remove "Accept-Encoding" } } } when HTTP_RESPONSE { STREAM::disable if { [HTTP::header value Content-Type] contains "text" }{ switch [IP::server_addr] { "x.x.x.nn" { set nvip "thisname_nn" } "x.x.x.uu" { set nvip "thisname_uu" } default { set nvip [IP::server_addr] } } STREAM::expression "@<\[Tt\]\[Ii\]\[Tt\]\[Ll\]\[Ee\]>@$nvip @" Active "stream profile" STREAM::enable } } when STREAM_MATCHED { log local0. "<\[Tt\]\[Ii\]\[Tt\]\[Ll\]\[Ee\]>: matched: [STREAM::match], replaced with: $nvip " }
- hoolio
Cirrostratus
That global variable was just there as an example of selectively removing the Accept-Encoding header if you knew you were going to rewrite the response. In your case, it doesn't seem like you can determine this from the request. So can you try this example which removes the header from every request?when HTTP_REQUEST { if { [HTTP::header exists "Accept-Encoding"] } { Remove the Accept-Encoding header from the request HTTP::header remove "Accept-Encoding" } } when HTTP_RESPONSE { STREAM::disable if { [HTTP::header value Content-Type] contains "text" }{ switch [IP::server_addr] { "x.x.x.nn" { set nvip "thisname_nn" } "x.x.x.uu" { set nvip "thisname_uu" } default { set nvip [IP::server_addr] } } STREAM::expression "@<\[Tt\]\[Ii\]\[Tt\]\[Ll\]\[Ee\]>@$nvip @" Active "stream profile" STREAM::enable } } when STREAM_MATCHED { log local0. "<\[Tt\]\[Ii\]\[Tt\]\[Ll\]\[Ee\]>: matched: [STREAM::match], replaced with: $nvip " }
- BMARTIN_12200
Nimbostratus
- hoolio
Cirrostratus
Hi Bruno,
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