apache httpd 不记录head 的请求。
2024-10-01 11:19:21
比如说用了阿里云的slb ,然后他会检测服务器是否正常运行,通常会发大量的HEAD 请求过来。
这样有规则的请求是可以屏蔽的。步骤如下:
- 在 <Directory />中添加 SetEnvIf Request_Method HEAD dontlog
- CustomLog 中修改成 CustomLog logs/access_log combined env=!dontlog
- reload 即可。
可参考http://www.howtoforge.com/setenvif_apache2
官网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.
nginx 里面就简单一些
if ( $request_method = "HEAD" )
{
access_log off ;
}
最新文章
- 系统吞吐量(TPS)、用户并发量、性能测试概念和公式
- struts2笔记4
- Ubuntu及Windows ADB设备no permissions的解决方案
- java web中Jdbc访问数据库步骤通俗解释(吃饭),与MVC的通俗解释(做饭)
- 网络操作与AFNetworking
- 获取UIButton的一些属性
- zoj 2156 - Charlie&;#39;s Change
- 苹果4S
- CSS学习笔记08 浮动
- docke镜像上传到dockerhub仓库和阿里云docker仓库的方法
- 7. ZooKeeper的stat结构
- java配置context.xml文件
- mongodb 集群分片
- ZYNQ EMIO使用及可重用封装
- WIN10 困扰多时的屏幕亮度 终于可以调节了-完美 -更新2018年2月28日
- DRP端口描述
- xss基础
- jQuery预览图
- Git:远程仓库的使用
- Yii2 cache的用法(1)
热门文章
- 二、Go语言开发环境安装与编写第一个Hello World
- Centos 7服务器搭建MySQL(mariadb)服务
- 关于用C-free进行C语言编程在电脑中生成的.exe和.o文件
- 【React踩坑记三】React项目报错Can't perform a React state update on an unmounted component
- Retrofit的文件上传和进度提示
- bind()函数的深入理解及两种兼容方法分析
- Openstack HA集群5-Keystone HA
- CF--思维练习--CodeForces - 216C - Hiring Staff (思维+模拟)
- CodeForces - 1047B Cover Points
- P1518 两只塔姆沃斯牛 The Tamworth Two(简单的搜索题)