nginx日志格式
2016-02-24 15:30
507 查看
Nginx中日志文件的格式在nginx.conf中定义,其默认格式如下:
#vim /usr/local/nginx/conf/nginx.conf
log_format access ‘$remote_addr – $remote_user [$time_local]
“$request” ‘‘$status $body_bytes_sent “$http_referer”
‘‘”$http_user_agent” $http_x_forwarded_for’;
其中,各个字段的含义如下:
1.$remote_addr 与$http_x_forwarded_for 用以记录客户端的ip地址;
2.$remote_user :用来记录客户端用户名称;
3.$time_local : 用来记录访问时间与时区;
4.$request : 用来记录请求的url与http协议;
5.$status : 用来记录请求状态;成功是200,
6.$body_bytes_s ent :记录发送给客户端文件主体内容大小;
7.$http_referer :用来记录从那个页面链接访问过来的;
8.$http_user_agent :记录客户端浏览器的相关信息;
本文出自 “蛮荒之力” 博客,转载请与作者联系!
#vim /usr/local/nginx/conf/nginx.conf
log_format access ‘$remote_addr – $remote_user [$time_local]
“$request” ‘‘$status $body_bytes_sent “$http_referer”
‘‘”$http_user_agent” $http_x_forwarded_for’;
其中,各个字段的含义如下:
1.$remote_addr 与$http_x_forwarded_for 用以记录客户端的ip地址;
2.$remote_user :用来记录客户端用户名称;
3.$time_local : 用来记录访问时间与时区;
4.$request : 用来记录请求的url与http协议;
5.$status : 用来记录请求状态;成功是200,
6.$body_bytes_s ent :记录发送给客户端文件主体内容大小;
7.$http_referer :用来记录从那个页面链接访问过来的;
8.$http_user_agent :记录客户端浏览器的相关信息;
本文出自 “蛮荒之力” 博客,转载请与作者联系!
相关文章推荐
- 【问题】Nginx日志中request_body为空
- Nginx重新编译添加模块
- 使用nginx针对URL实现负载均衡或者说接口定向分发
- 利用Nginx做负载均衡
- windows下配置nginx+php环境
- nginx禁止直接通过IP地址访问
- lnmp nginx和php升级方法
- Nginx 变量漫谈(三)
- nginx 用if语句修改query_string
- nginx多域名配置与 pathinfo(/ 文件夹形式) URL访问不支持配置
- Nginx 502 BAD GateWay错误解决方…
- 又找到一篇Nginx配置经典教程
- Nginx学习网站推荐
- Nginx查看并发数的两种方法及详解
- nginx环境wordpress 固定链接实现…
- NGINX 配置404错误页面转向
- nginx php5 整合
- nginx安装及配置
- 很强的nginx rewrite研究(强烈推荐…
- nginx 全局变量