Access logs on a busy proxy grow faster than I expect, and the default rotation is weekly. Nginx Proxy Manager lets you replace the rotation file with your own.
According to the Nginx Proxy Manager documentation, NPM rotates the access and error logs weekly and keeps 4 and 10 log files respectively. Depending on usage that can mean large files, especially for access logs. The docs describe customising it with a mount: your own file goes to /etc/logrotate.d/nginx-proxy-manager inside the container.
services:
app:
image: jc21/nginx-proxy-manager:latest
volumes:
- /mnt/user/appdata/npm/data:/data
- /mnt/user/appdata/npm/logrotate.custom:/etc/logrotate.d/nginx-proxy-manager
Start from the default file, which lives in the NPM repository. The access log block looks like this there:
/data/logs/*_access.log /data/logs/*/access.log {
su npm npm
create 0644
weekly
rotate 4
missingok
notifempty
compress
sharedscripts
postrotate
kill -USR1 `cat /run/nginx/nginx.pid 2>/dev/null` 2>/dev/null || true
endscript
}
I would copy the whole default file into logrotate.custom and change only the numbers. For example, swap weekly for size 50M (the default file already uses a size line for backend.log) and lower rotate if disk space matters. Keep the postrotate part: nginx logs rotate by renaming the files and then sending the master process a USR1 signal, which makes it reopen its log files, as the nginx control documentation describes.
The caveat is that your file replaces the default one completely, it does not add to it. Leave out the error log block or the backend.log block and those logs are no longer rotated. Compare against the default of the image version you run, since I only looked at the current repository file.
Pin the image to a version you have tested, as the file may differ between releases.
Further reading: Nginx Proxy Manager advanced configuration, Default logrotate file in the NPM repository, Controlling nginx
Going deeper: Guide: fix a 502 Bad Gateway in Nginx Proxy Manager, with a checklist that finds the cause