nginx 通过配置文件切割访问日志

在配置文件server部分,添加以下内容:

if ($time_iso8601 ~ "(\d{4})-(\d{2})-(\d{2})") {
set $time $1$2$3;
}

access_log logs/${server_name}_${time}_access.log;

posted @ 2020-12-28 16:53  烟花❤易冷  阅读(90)  评论(0编辑  收藏  举报