Linux nginx 玩转日志模块

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';

log_format # 日志格式

$remote_addr #远程地址,记录客户端ip地址
$remote_user #远程访问用户
[$tune_local] 服务器自身时间
$request #请求,记录请求的url和http协议
$status # 状态,记录http请求状态码
$body_bytes_sent # 发送给客户端的字节数,不包括响应头的大小
$http_referer #记录从哪个页面链接访问过来的
$http_user_agent #记录客户端浏览器代理相关信息
$http_x_forwarded_for #代理Ip

posted on 2024-05-10 13:48  孤灯引路人  阅读(2)  评论(0编辑  收藏  举报

导航