Forum Discussion
Romain_Vergnio1
Nimbostratus
Mar 31, 2006How to remove the "Server: BIGIP" header when using "HTTP::redirect"
Hello all,
I use an iRule to redirect HTTP traffic to HTTPS and it works fine, here it is :
----------------------------------------------------------
when HTTP_REQUEST {
Redirects all to HTTPS keeps URI intact
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
----------------------------------------------------------
However I noticed that BigIP adds a "Server: BIG-IP" header in the response, is there a way to remove it ?
I tried all these examples without success :
----------------------------------------------------------
when HTTP_REQUEST {
Redirects all to HTTPS keeps URI intact
HTTP::redirect https://[HTTP::host][HTTP::uri]
HTTP::header remove Server
}
-----------------------------------------------------------
or
-----------------------------------------------------------
when HTTP_REQUEST {
Redirects all to HTTPS keeps URI intact
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
when HTTP_RESPONSE {
HTTP::header remove Server
}
------------------------------------------------------------
or even (I know it's the same but it tried it anyway...) :
iRule n°1
------------------------------------------------------------
when HTTP_REQUEST {
Redirects all to HTTPS keeps URI intact
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
------------------------------------------------------------
iRule n°2
------------------------------------------------------------
when HTTP_RESPONSE {
HTTP::header remove Server
}
------------------------------------------------------------
It seems that "when HTTP_RESPONSE" matches only when receiving the response from the web server, not when the "redirect" function is used.
Anyone has an idea ?
Thanks a lot.
Regards,
Romain Vergniol
- hoolio
Cirrostratus
I thought you might be able to avoid the Server: BIG-IP header by using HTTP::respond, like so: - unRuleY_95363Historic F5 AccountYou could try specifying the Server header in the HTTP::respond command. eg:
when HTTP_REQUEST { HTTP::respond 302 Location "https://[HTTP::host][HTTP::uri]" Server blablabla }
- bl0ndie_127134Historic F5 AccountTry this rule out then ...
when HTTP_REQUEST { set my_loc "http://www.i_want_a_bigip_for_christmas.com" TCP::respond "HTTP/1.1 302 Found\r\nLocation: $my_loc\r\nConnection: close\r\nContent-Length: 0\r\n\r\n" TCP::close }
- Jason_R-J_47029
Nimbostratus
As of 9.4.2 you can use HTTP::respond to achieve the same thing:
when HTTP_REQUEST { HTTP::respond 302 noserver Location "https://[HTTP::host][HTTP::uri]" }
The noserver flag suppresses that header.
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