首页 软件

Nginx日志解析及举例

2021-09-01 23:19

$remote_addr : 与$http_x_forwarded_for 用以记录客户端的ip地址;

$remote_user : 用来记录客户端用户名称;

$time_local : 用来记录访问时间与时区;

$request : 用来记录请求的url与http协议;

$status : 用来记录请求状态;成功是200,

$body_bytes_sent :记录发送给客户端文件主体内容大小;

$http_referer :用来记录从那个页面链接访问过来的;

$http_user_agent :记录客户浏览器的相关信息;

$upstream_addr : 访问端口;

$upstream_response_time : 响应时间;

$request_time :请求时间;

$geoip_country_code :用户地理位置代码;

$http_host : 服务器地址;

$http_accept_language : 用户浏览器语言;

$http_cookie :记录cookie内容

$sent_http_set_cookie :发送cookie

变量名称

变量描述

举例说明

$remote_addr

客户端地址

113.140.15.90

$remote_user

客户端用户名称

-

$time_local

访问时间和时区

18/Jul/2012:17:00:01 +0800

$request

请求的URI和HTTP协议

“GET /pa/img/home/logo-alipay-t.png HTTP/1.1″

$http_host

请求地址,即浏览器中你输入的地址(IP或域名)

img.alipay.com

10.253.70.103

$status

HTTP请求状态

200

$upstream_status

upstream状态

200

$body_bytes_sent

发送给客户端文件内容大小

547

$http_referer

跳转来源

“https://cashier.alipay.com…/”

$http_user_agent

用户终端代理

“Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; GTB7.0; .NET4.0C;

$ssl_protocol

SSL协议版本

TLSv1

$ssl_cipher

交换数据中的算法

RC4-SHA

$upstream_addr

后台upstream的地址,即真正提供服务的主机地址

10.228.35.247:80

$request_time

整个请求的总时间

0.205

$upstream_response_time

请求过程中,upstream响应时间

0.002

返回首页
返回顶部