Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set limit for Nginx log files on Mac OS?

Tags:

macos

nginx

Nginx occupies all the available disk space. How to set limit for log files on Mac OS?

like image 687
Max Lipsky Avatar asked Oct 20 '25 08:10

Max Lipsky


1 Answers

Rotate the log files. On OS X, newsyslog is the preferred utility to do that. Set up a file like this in /etc/newsyslog.d/nginx.conf:

# logfilename          [owner:group]    mode count size when  flags [/pid_file] [sig_num]
/var/log/nginx.log     deceze:wheel     644  2     1024 *     J

Read https://www.newsyslog.org/manual.html for more information.

like image 113
deceze Avatar answered Oct 22 '25 00:10

deceze