Removing HTTP headers in Apache2

On a site hosted on Apache2.2.9, I would like to remove the headers below.

Date Thu, 16 Dec 2010 17:49:45 GMT Apache Server Keep-Alive timeout = 15, max = 92 Keep-Alive Connection

Let me preempt the discussion of whether the server is correct / legal / pleasant remvoe and date: I have read the standard and I still want to do it. The stored bytes are significant (average response size ~ 200B).

In my site.conf (last download from apache2.conf) I tried this without success:

Header unset Date Header unset Server Header unset Connection Header unset Keep-Alive 

Other unset unset directives work (so mod_headers are loaded).

+7
source share
1 answer

Did you notice this error report ? Failure to disable certain headers is a design issue in Apache. The attached patch contains a way to remove the server header. Looking at this briefly, it seems that lobotomization of the rest of the unwanted default included headers can be done in the modules / http / http _filters.c, around line 1000 ...

+5
source

All Articles