在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就行了
「点点赞赏,手留余香」
声明:本文为原创文章,版权归旷野小站所有,欢迎分享本文,转载请保留出处!
你可能也喜欢
- ♥ iptables命令及详解总结笔记10/08
- ♥ linux 主机禁用IPv6网络11/14
- ♥ rsync命令带端口参数的书写格式12/19
- ♥ Nginx连接与请求速率限制详解10/03
- ♥ Linux 系统中使用 iptables 来封禁指定的 IP 段10/07
- ♥ docker logs命令详解03/09