html tool

2017年3月22日星期三

nginx log 字段说明

add: http://www.ha97.com/5879.html

nginx的log_format有很多可选的参数用于标示服务器的活动状态,默认的是:
‘$remote_addr – $remote_user [$time_local] “$request” ‘
‘$status $body_bytes_sent “$http_referer” ‘
‘”$http_user_agent” “$http_x_forwarded_for”‘;
如果要记录更详细的信息需要自己修改log_format,具体可设置的参数格式及说明如下:
参数说明示例
$remote_addr客户端地址219.227.111.255
$remote_user客户端用户名称
$time_local访问时间和时区18/Jul/2014:17:00:01 +0800
$request请求的URI和HTTP协议“GET /article-10000.html HTTP/1.1”
$http_host请求地址,即浏览器中你输入的地址(IP或域名)www.ha97.com
198.98.120.87
$statusHTTP请求状态200
$upstream_statusupstream状态200
$body_bytes_sent发送给客户端文件内容大小1547
$http_refererurl跳转来源https://www.google.com/
$http_user_agent用户终端浏览器等信息“Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; GTB7.0; .NET4.0C;
$ssl_protocolSSL协议版本TLSv1
$ssl_cipher交换数据中的算法RC4-SHA
$upstream_addr后台upstream的地址,即真正提供服务的主机地址10.36.10.80:80
$request_time整个请求的总时间0.165
$upstream_response_time请求过程中,upstream响应时间0.002

没有评论:

发表评论