蓝忧无泪 发表于 2019-1-14 14:41:10

nginx的access.log与error.log

查找日志存放地址
find / -name nginx.conf


根据你找出来的地址,尽心vi编辑,进入nginx.conf文件进行查找路径

vi /usr/servers/nginx/conf/nginx.conf


从而找到,我机子的两个日志存放地点:
/var/logdata/nginx/access.log
/var/logdata/nginx/error.log

查看access访问日志
vi /var/logdata/nginx/access.log
100.109.195.91 - - "GET /data/upload/shop/common/loading.gif HTTP/1.0" 200 134 "http://www.mall121.com/" "Mozilla/4.0 (compatible; MSIE 8.0; Trident/4.0; Windows NT 6.1; SLCC2 2.5.5231; .NET CLR 2.0.50727; .NET CLR 4.1.23457; .NET CLR 4.0.23457; Media Center PC 6.0; MS-WK 8)" "140.205.201.12"
100.109.195.78 - - "GET /shop/templates/default/images/u-safe.png HTTP/1.0" 200 3675 "http://www.mall121.com/" "Mozilla/4.0 (compatible; MSIE 8.0; Trident/4.0; Windows NT 6.1; SLCC2 2.5.5231; .NET CLR 2.0.50727; .NET CLR 4.1.23457; .NET CLR 4.0.23457; Media Center PC 6.0; MS-WK 8)" "140.205.201.12"
100.109.195.26 - - "GET /data/upload/shop/adv/05240495346955824.jpg HTTP/1.0" 404 564 "http://www.mall121.com/" "Mozilla/4.0 (compatible; MSIE 8.0; Trident/4.0; Windows NT 6.1; SLCC2 2.5.5231; .NET CLR 2.0.50727; .NET CLR 4.1.23457; .NET CLR 4.0.23457; Media Center PC 6.0; MS-WK 8)" "140.205.201.12"1.100.109.195.91 :
$remote_addr : 客户端(用户)IP地址
2.:
$time_local:访问时间
3."GET /data/upload/shop/common/loading.gif HTTP/1.0":
"$request"get请求的url地址(目标url地址)的host
4.200:
'$status请求状态(状态码,200表示成功,404表示页面不存在,301表示永久重定向等,具体状态码可以在网上找相关文章,不再赘述)
5. 134 :
$body_bytes_sent :请求页面大小,默认为B(byte
6."http://www.mall121.com/" :
"$http_referer" : 来源页面,即从哪个页面转到本页,专业名称叫做“referer”
7."Mozilla/4.0 (compatible; MSIE 8.0; Trident/4.0; Windows NT 6.1; SLCC2 2.5.5231; .NET CLR 2.0.50727; .NET CLR 4.1.23457; .NET CLR 4.0.23457; Media Center PC 6.0; MS-WK 8)":
$http_user_agent:用户浏览器其他信息,浏览器版本、浏览器类型
8. "140.205.201.12" :
$http_x_forwarded_for"


错误日志同理,
vi /var/logdata/nginx/error.log


页: [1]
查看完整版本: nginx的access.log与error.log