在配置文件server部分,添加以下内容:
if ($time_iso8601 ~ "(\d{4})-(\d{2})-(\d{2})") { set $time $1$2$3; }
access_log logs/${server_name}_${time}_access.log;