在server段外面自定义一个日志格式
log_format cdn '$http_x_forwarded_for - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
修改对应虚拟机的 access_log /home/wwwlogs/xxxx.log; 为 access_log /home/wwwlogs/xxxx.log cdn;
重启nginx就行了
本文为原创文章,版权归旷野小站所有,欢迎分享本文,转载请保留出处!
你可能也喜欢
- ♥ docker cp命令详解03/09
- ♥ docker load命令详解03/09
- ♥ nps安装教程11/28
- ♥ linux中查看本机外网ip地址命令10/28
- ♥ 屏蔽IP地址及IP段的规则02/01
- ♥ root用户删除文件时报Operation not permitted错误04/14