在server段外面自定义一个日志格式
log_format cdn '$http_x_forwarded_for - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
修改对应虚拟机vhost文件
access_log /home/wwwlogs/xxxx.log;
修改为
access_log /home/wwwlogs/xxxx.log cdn;
评论