Apache日志不记录head请求

作者: 5473 分类: Apache 发布时间: 2019-08-17 22:05 阅读数:373

阿里云的slb ,开启健康检测通常会发大量的HEAD 请求过来,这些日志需要屏蔽。步骤如下:

参考:http://httpd.apache.org/docs/2.2/mod/mod_setenvif.html

不只是Request_Method 还有其他变量也可以进行判断

  • Host
  • User-Agent
  • Referer
  • Accept-Language
  • Remote_Host: the hostname (if available) of the client making the request.
  • Remote_Addr: the IP address of the client making the request.
  • Server_Addr: the IP address of the server on which the request was received (only with versions later than 2.0.43).
  • Request_Method: the name of the method being used (GET, POST, etc.).
  • Request_Protocol: the name and version of the protocol with which the request was made (e.g., “HTTP/0.9”, “HTTP/1.1”, etc.).
  • Request_URI: the resource requested on the HTTP request line – generally the portion of the URL following the scheme and host portion without the query string.

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!

发表评论

电子邮件地址不会被公开。 必填项已用*标注