douzhi3586 2012-09-13 20:50
浏览 381

停止Apache阻止ETag

I have written a web application that uses someone else's API that requires ETags. I have tried this code:

header("ETagbleh: whatever");

Which works perfectly. However, when I set this:

header("ETag: whatever");

Nothing happens. I have heard that it may be Apache blocking the sending of ETags, but I'm not sure. I've done a search for ETag in my apache2.conf and can't find anything to uncomment / remove, so I came here to ask.

So, how can I stop Apache blocking my headers?

Edit: I'm using Apache 2.2.22, and I assumed that the scripting language was irrelevant, given that PHP 5.4.4, which is what I'm using, can set any other header fine.

  • 写回答

1条回答 默认 最新

  • dongzanghong4379 2015-09-09 10:02
    关注

    I've had the same problem.

    A very popular way to remove ETags in Apache2 is adding the following configuration:

    Header unset ETag
    FileETag None
    

    Remove the first config line, if you find it in your configuration.

    A bit more difficult to find is mod_include causing the problem. By default the ETag-Header is removed by this module. But you can allow it by configuration. So add something like this:

     <IfModule mod_include.c>
         SSIETag on
     </IfModule>
    

    See here for more information.

    评论

报告相同问题?

悬赏问题

  • ¥35 平滑拟合曲线该如何生成
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了
  • ¥15 链式存储应该如何解决
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站