We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b0204d commit 63d5c23Copy full SHA for 63d5c23
markdown-file/Nginx-Install-And-Settings.md
@@ -684,11 +684,12 @@ location ~ .*$ {
684
### Nginx 自动分割日志文件
685
686
- 在 [Tomcat 安装和配置、优化](Tomcat-Install-And-Settings.md) 文章已经使用了 cronolog,这里也借用 cronolog 来实现分割。具体安装看文章。
687
+- 创建目录:`mkdir -p /data/nginx/log/logs`
688
- 创建命名管道:`mkfifo /data/nginx/log/access_log.log`
689
- 配置 cronolog(按天):`nohup cat /data/nginx/log/access_log.log | /usr/sbin/cronolog /data/nginx/log/logs/access-%Y-%m-%d.log &`
690
- 配置 cronolog(按月):`nohup cat /data/nginx/log/access_log.log | /usr/sbin/cronolog /data/nginx/log/logs/access-%Y-%m.log &`
691
- 编辑 nginx 配置文件,配置 log 位置:`access_log /data/nginx/log/access_log.log;`
-- 重启 nginx
692
+- 重启 nginx,最终可以在 /data/nginx/log/logs 目录下看到生成的 log
693
694
### Nginx 处理跨域请求
695
0 commit comments