Forum Discussion
ryan_111816
Nimbostratus
Dec 16, 2009Strip HTTP Server Header
I'm trying to find an iRule which will strip out the Server header from my server's HTTP responses. I've found the following rule under the samples section: http://devcentral.f5.com/wiki/default.aspx...
hoolio
Cirrostratus
Dec 16, 2009Hi Ryan,
That would be pretty straightforward:
when HTTP_RESPONSE {
Remove all instances of the Server header
HTTP::header remove Server
}
You might also want to remove the X- headers as they can contain app identifying signatures (like x-powered-by for example).
when HTTP_RESPONSE {
Remove all instances of the Server header
HTTP::header remove Server
Remove all headers starting with x-
foreach header_name [HTTP::header names] {
if {[string match -nocase x-* $header_name]}{
HTTP::header remove $header_name
}
}
}
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
