Forum Discussion
mrbongoco_64052
Apr 23, 2012Nimbostratus
HTTP_Response Client side
Hi
Ive been looking to write and Irule to strip out the HTTP::Header for all "Server" types but have been unable to get this work.
Essentially it works perfectly server side, but when a user initiates a connection to the VIP they get BIG-IP and Apache in the http::header server type:
This is a sample rule:
when HTTP_RESPONSE {
clientside {
if { [HTTP::header "Server"] contains "Apache" } {
HTTP::header replace "Server" "testing"
} elseif {
[HTTP::header "Server"] contains "IIS"} {
HTTP::header replace "Server" "testing"
}
}
}
The rule saves but it doesnt like the way I have forced it client side, I have done this as I believe the http response is a server side TCL command only.
Im wondering if I should be doing this another way but my Irule TCL is just not strong enough.
Thanks in advance for any pointers.
- Michael_YatesNimbostratusHi mrbongoco,
- John_Matlock_42NimbostratusIn addition to Michaels response, clientside in this context isn't required as when you perform an action in the HTTP_RESPONSE you're modifying the packets as they're on their way back to the client. I dropped this irule in my test environment and confirmed it worked.
when HTTP_RESPONSE { if { [HTTP::header "Server"] contains "Microsoft-IIS/7.0" } { HTTP::header replace "Server" "testing" } }
- mrbongoco_64052NimbostratusHi
- Bryce_KlimoskiNimbostratusPosted By mrbongoco on 04/23/2012 10:36 PM
With HTTP::redirect the server header is hardwired and the only way to by-pass this is to use HTTP::respond to send out the a 302 response code with a location header.
HTTP::respond 302 noserver Location "http://www.domain.org" Server "testing"
If your using the F5 to server up the initial landing page, you could do this.
HTTP::respond noserver Server "testing" content $content
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