[GH-ISSUE #183] Logs grow indefinitely #160

Closed
opened 2026-02-26 06:31:00 +03:00 by kerem · 11 comments
Owner

Originally created by @rimas-kudelis on GitHub (Aug 7, 2019).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/183

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?

Originally created by @rimas-kudelis on GitHub (Aug 7, 2019). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/183 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?
kerem 2026-02-26 06:31:00 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@beloniki commented on GitHub (Sep 24, 2019):

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
}
<!-- gh-comment-id:534536613 --> @beloniki commented on GitHub (Sep 24, 2019): 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 } ```
Author
Owner

@nekoliten commented on GitHub (Nov 24, 2020):

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.

<!-- gh-comment-id:733239290 --> @nekoliten commented on GitHub (Nov 24, 2020): 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.
Author
Owner

@MaxVRAM commented on GitHub (Feb 28, 2021):

Would be good to have this a function of the Docker deployment itself. I just realised my Pi was filled with 4GB of logs.

<!-- gh-comment-id:787440466 --> @MaxVRAM commented on GitHub (Feb 28, 2021): Would be good to have this a function of the Docker deployment itself. I just realised my Pi was filled with 4GB of logs.
Author
Owner

@ameinild commented on GitHub (Mar 8, 2021):

I'd like to chime in on this as well. Would it be possible that the container can logrotate itself, or provide some log settings etc?

<!-- gh-comment-id:792793537 --> @ameinild commented on GitHub (Mar 8, 2021): I'd like to chime in on this as well. Would it be possible that the container can logrotate itself, or provide some log settings etc?
Author
Owner

@beloniki commented on GitHub (Mar 27, 2021):

I think, that it would be useful to give to user a choice: send logs to stdout like this:

error_log /dev/stdout warn;
access_log /dev/stdout proxy;

, or put into files.

@MaxVRAM
You could create your Dockerfile and replace logging directives in /etc/nginx/nginx.conf by stdout. Then you can use native docker log method to send logs to syslog collector https://docs.docker.com/config/containers/logging/syslog/
or to store locally https://docs.docker.com/config/containers/logging/local/ and limit size by using max-size option.

<!-- gh-comment-id:808706854 --> @beloniki commented on GitHub (Mar 27, 2021): I think, that it would be useful to give to user a choice: send logs to stdout like this: ``` error_log /dev/stdout warn; access_log /dev/stdout proxy; ``` , or put into files. @MaxVRAM You could create your **Dockerfile** and replace logging directives in /etc/nginx/nginx.conf by stdout. Then you can use native docker log method to send logs to syslog collector https://docs.docker.com/config/containers/logging/syslog/ or to store locally https://docs.docker.com/config/containers/logging/local/ and limit size by using **max-size** option.
Author
Owner

@generalsnipe commented on GitHub (May 15, 2021):

Just +1 on this. I too recently had a server go down due to log taking 11GB. I personally only need the last week of data. Anything over that is just taking space.

<!-- gh-comment-id:841700772 --> @generalsnipe commented on GitHub (May 15, 2021): Just +1 on this. I too recently had a server go down due to log taking 11GB. I personally only need the last week of data. Anything over that is just taking space.
Author
Owner

@internetfreak commented on GitHub (May 17, 2021):

Supporting this as well, had issues to download some files and after searching for quite a while I came to check the proxy and then I saw what was wrong. This should not happen

<!-- gh-comment-id:842526154 --> @internetfreak commented on GitHub (May 17, 2021): Supporting this as well, had issues to download some files and after searching for quite a while I came to check the proxy and then I saw what was wrong. This should not happen
Author
Owner

@gadgetusaf commented on GitHub (Jul 5, 2021):

I am supporting this as well and have had a similar issue. Is there an eta on when logrotate functionality will be merged in?

<!-- gh-comment-id:874244888 --> @gadgetusaf commented on GitHub (Jul 5, 2021): I am supporting this as well and have had a similar issue. Is there an eta on when logrotate functionality will be merged in?
Author
Owner

@shroomlife commented on GitHub (Jul 9, 2021):

+1

<!-- gh-comment-id:877066244 --> @shroomlife commented on GitHub (Jul 9, 2021): +1
Author
Owner

@Mrs-Feathers commented on GitHub (Aug 17, 2023):

just ran into this issue on the current build.. logs filled up 50gbs within a week and i didn't know until everything crashed.

<!-- gh-comment-id:1682972384 --> @Mrs-Feathers commented on GitHub (Aug 17, 2023): just ran into this issue on the current build.. logs filled up 50gbs within a week and i didn't know until everything crashed.
Author
Owner

@FibreTTP commented on GitHub (Sep 27, 2023):

@Mrs-Feathers refer: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2938

<!-- gh-comment-id:1736912404 --> @FibreTTP commented on GitHub (Sep 27, 2023): @Mrs-Feathers refer: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2938
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#160
No description provided.