Header unset Server not working for static files

Posted by Sam Lee on Server Fault See other posts from Server Fault or by Sam Lee
Published on 2011-03-12T09:53:34Z Indexed on 2011/03/12 16:11 UTC
Read the original article Hit count: 264

Filed under:
|

I'm trying to unset the "Server" field in response headers. I do this using Header unset Server, and that works fine for requests handled by mod_perl. However, for requests to /static I use Apache to serve static files. For some reason, when these files are loaded directly in the browser, the Server field is not removed. How can I go about fixing this?

Relevent parts of my httpd.conf:

LoadModule headers_module modules/mod_headers.so
Header unset Server

<VirtualHost *:80>

    <Location />
        SetHandler modperl
        PerlResponseHandler MyHandler
    </Location>

    Alias /static/ /home/site/static/

    <Location /static>
        SetHandler None
    </Location>
</VirtualHost>

© Server Fault or respective owner

Related posts about apache

Related posts about httpd.conf