nginx 配置access.log文件,每天生成一个新文件。

在http模块加上下面蓝色的配置:

http {
    include       mime.types;
    default_type  application/octet-stream;
    map $time_iso8601 $logdate {
        '~^(?<ymd>\d{4}-\d{2}-\d{2})' $ymd;
        default    'date-not-found';
    }
 access_log  logs/access-$logdate.log;
}

  

posted @ 2024-06-24 10:01  HelloWord_wuxuemin  阅读(24)  评论(0编辑  收藏  举报