删除HTTP标头中的Apache2 [英] Removing http headers in Apache2

查看:399
本文介绍了删除HTTP标头中的Apache2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个Apache2.2.9托管网站,我想删除下面的头。

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

日期星期四,2010年12月16日十七时49分45秒GMT
阿帕奇服务器
保持活动超时= 15,上限= 92
连接保持

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

让我preempt上它是否是正确的/法律/不错的remvoe服务器和日期的讨论:我已阅读标准,我还是要去做。节省的字节是显著(平均响应大小为200B〜)。

Let me preempt the discussion on whether or not it it right/legal/nice to remvoe Server and Date: I have read the standard and I still want to do it. The bytes saved are significant (average response size is ~200B).

在我site.conf(从去年apache2.conf负载)我都没有成功尝试这样的:

In my site.conf (last load from apache2.conf) I have tried this with no success:

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

其他头未设置的指令做工作(所以mod_headers中加载)。

Other Header unset directives do work (so mod_headers is loaded).

推荐答案

你有没有注意到这一点的 bug报告?由于无法取消设置特定的标题是Apache的一个设计问题。连接该补丁包含一种方法来去除Server头。看着它简单地似乎lobotomizing不需要的默认其余包括头文件可以在模块做/ HTTP / http_filters.c,围绕行1000 ...

Have you noticed this bug report? The inability to unset certain headers is a design issue in Apache. The patch attached contains a way to remove the Server header. Looking at it briefly it seems that lobotomizing the rest of the unwanted default included headers can be done at modules/http/http_filters.c, around line 1000...

这篇关于删除HTTP标头中的Apache2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆