月小升记得以前nginx没有办法读取日期,今天找到个办法居然可以。
server{ location ~ \.php$ { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; } error_page 404 /404.html; location = /40x.html { } if ($time_iso8601 ~ '(\d{4}-\d{2}-\d{2})') { set $tttt $1; } access_log /backup/wwwlogs/$tttt.java-er.com.log; } |
系统自动生成了2020-09-07.java-er.com.log文件
标签:index,log,按天,nginx,日志,com,fastcgi,er From: https://www.cnblogs.com/tiancai/p/17348724.html