Ubuntu – Apache2 remove response headers

apache-2.2Ubuntu

I have been going crazy trying to remove response headers from my Apache2 server. I have mod_headers enabled and I have 'Header unset BLAH_HEADER_NAME' in my apache2.conf file, but it doesn't appear to be working, though 'Header append' appears to work..go figure.

I've read that mod_perl might work, but I don't have any experience doing this..any ideas. I also read that 'Header unset' might be bugged, is this confirmed.

Best Answer

I can't really imagine why you'd want to unset all of those, breaking your compliance with the HTTP/1.1 standard.. but, Server cannot be unset (see here), while the others ought to work; try:

Header always unset Content-Length
Header onsuccess unset Content-Length