0

I setup Nginx(1.18.0) and Supervisor(version: 4.2.2) in an alpine docker image, the following is the supervisor conf:

[supervisord]
nodaemon=true

[program:nginx]
command=/usr/local/nginx/sbin/nginx -g 'daemon off;'
autostart=true
autorestart=true
priority=10
stdout_events_enabled=true
stderr_events_enabled=true
stdout_logfile_maxbytes=1KB
stderr_logfile_maxbytes=1KB
stdout_logfile_backups=5
stderr_logfile_backups=5
stdout_logfile=/var/log/nginx/access.log
stderr_logfile=/var/log/nginx/error.log
stopsignal=QUIT

After adding *_logfile_maxbytes and *_logfile_backups with test values, I was expecting the log files to be rotated each time they reach 1KB, but that is not happening:

bash-5.1# ls /var/log/nginx/ -lh
total 16K    
-rw-r--r--    1 root     root       12.5K Sep 21 10:43 access.log
-rw-r--r--    1 root     root           0 Sep 21 10:35 error.log

logrotate files:

bash-5.1# ls /etc/logrotate.d/
acpid        supervisord

The Nginx was compiled and installed and didn't install it through apk.

Any possible thoughts?

Sadmi
  • 11
  • 3

0 Answers0