在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就行了
本文为原创文章,版权归旷野小站所有,欢迎分享本文,转载请保留出处!
你可能也喜欢
- ♥ Linux 中设置 SSH 无密码登录11/01
- ♥ lnmp清理wwwlogs日志命令06/16
- ♥ WSL创建备份及还原03/01
- ♥ 用Chatwoot自建网站客服系统12/15
- ♥ filebrowser 使用方法03/10
- ♥ linux后台运行命令03/23