Nginx-proxy-manager: Logs grow indefinitely

Created on 7 Aug 2019  路  2Comments  路  Source: jc21/nginx-proxy-manager

I had an issue with a setup of nginx-proxy-manager. I have it set up for a relative of mine as a docker container in an Ubuntu virtual machine, and suddently it began glitching. The latest symptoms was that port 80 was accessible from the other machines in the network, but port 81 was not.
Apparently, the culprit was the logs which grew to over 2GB in just a few months.
By looking at /data/logs in the container file system, I noticed that the logs are never rotated and just grow indefinitely, and I think it's bound to hit pretty much every user at some point.
Thus I would like to suggest to either configure log rotation out of the box, or to explain how this should be done externally (since I just noticed that /data volume is a directory exposed from the host machine).
Or perhaps another option would be to allow easy disabling of nginx logging into files altogether, and instead let it log to stdout?

bug

Most helpful comment

You can use default logrotated:

/path/to/nginx/*.log {
        maxsize 500M
        daily
        missingok
        rotate 14
        compress
        notifempty
        create 0640 root root
        sharedscripts
        postrotate
                docker exec CONTAINER_NAME bash -c 'kill -USR1 `cat /var/run/nginx.pid`'
        endscript
}

All 2 comments

You can use default logrotated:

/path/to/nginx/*.log {
        maxsize 500M
        daily
        missingok
        rotate 14
        compress
        notifempty
        create 0640 root root
        sharedscripts
        postrotate
                docker exec CONTAINER_NAME bash -c 'kill -USR1 `cat /var/run/nginx.pid`'
        endscript
}

Ran into this issue today myself when my server was suddenly out of disk space (my bad for not setting up alerts for it), upon investigation I noticed that the proxy-manager log folder contained several 25+ GB logs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rlogiacco picture rlogiacco  路  6Comments

McCloudS picture McCloudS  路  3Comments

Kranzy picture Kranzy  路  7Comments

spoolr picture spoolr  路  5Comments

Sigri44 picture Sigri44  路  3Comments