-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
β Have you read and understood the above guidelines?
yes
π What is the name of the script you are using?
Nginx Proxy Manager
π What was the exact command used to execute the script?
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/nginxproxymanager.sh)"
βοΈ What settings are you using?
- Default Settings
- Advanced Settings
π₯οΈ Which Linux distribution are you using?
Debian/Proxmox 8.1.4
π Provide a clear and concise description of the issue.
After months of running smoothly with default settings, the LXC container's npm suddenly stopped working properly. The Web UI showed "internal error" for any attempted changes.
Long story short, it turned out to be a storage issue. The default storage limit of 4GB was full due to oversized log folders.
The du command returned:
...
769M /var
341M /root
1.6G /data
...
1.6G /data/logs
...
399M /var/log
...
1.1G /data/logs/proxy-host-8_access.log
Root cause:
checking the logrotate configuration /etc/logrotate.d/nginx-proxy-manager:
cat /etc/logrotate.d/nginx-proxy-manager
/data/logs/*_access.log /data/logs/*/access.log {
su npm npm
create 0644
weekly
rotate 4
missingok
notifempty
compress
sharedscripts
postrotate
/bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true
endscript
}
/data/logs/*_error.log /data/logs/*/error.log {
su npm npm
create 0644
weekly
rotate 10
missingok
notifempty
compress
sharedscripts
postrotate
/bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true
endscript
Please note that the user npm does not exist in the LXC. Instead nginx runs as root.
FIX:
I suggest changing /etc/logrotate.d/nginx-proxy-manager to this:
/data/logs/*_access.log /data/logs/*/access.log {
create 0644 root root
weekly
rotate 4
missingok
notifempty
compress
maxsize 100M
maxage 365
dateext
sharedscripts
postrotate
/bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true
endscript
}
/data/logs/*_error.log /data/logs/*/error.log {
create 0644 root root
weekly
rotate 10
missingok
notifempty
compress
maxsize 50M
maxage 365
dateext
sharedscripts
postrotate
/bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true
endscript
}
Then run logrotate -v -f /etc/logrotate.d/nginx-proxy-manager
Optional for testing, run first logrotate -d /etc/logrotate.d/nginx-proxy-manager, to see what will happen.
The final result:
23M /data/logs
π Steps to reproduce the issue.
- Install Nginx Proxy Manager with the command
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/nginxproxymanager.sh)"and use default settings. - Test the configuration (dry run):
logrotate -d /etc/logrotate.d/nginx-proxy-manager - Alternatively, check the content of
/etc/logrotate.d/nginx-proxy-manager.
β Paste the full error output (if available).
logrotate -d /etc/logrotate.d/nginx-proxy-manager returns:
reading config file /etc/logrotate.d/nginx-proxy-manager
error: /etc/logrotate.d/nginx-proxy-manager:2 unknown user 'npm'
error: found error in /data/logs/*_access.log /data/logs/*/access.log , skipping
removing last 1 log configs
error: /etc/logrotate.d/nginx-proxy-manager:16 unknown user 'npm'
error: found error in /data/logs/*_error.log /data/logs/*/error.log , skipping
removing last 1 log configs
Reading state from file: /var/lib/logrotate/status
Allocating hash table for state file, size 64 entries
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
πΌοΈ Additional context (optional).
No response