【发布时间】:2014-05-28 00:58:52
【问题描述】:
我是服务器端的新手。我已经在我的服务器(Amazon EC2 32 位实例)上安装了 Nginx 来运行我的 Ruby on Rails 应用程序。我已经为我的 nginx logrotate 编写了以下配置。
/var/log/nginx/*.log {
daily
missingok
rotate 12
compress
delaycompress
notifempty
create 0640 www-data adm
sharedscripts
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi; \
endscript
postrotate
[ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
endscript
}
但问题是,尽管轮换间隔保持为每天..有一个文件(nginx 访问日志)在 4.5 Gb 左右生成。我不知道为什么会发生这种情况,任何人都可以向我建议什么我可以避免这种情况。有人可以帮我解决这个问题。
【问题讨论】:
标签: ubuntu logging nginx amazon-ec2