/
Nginx Not Rotating Logs

Nginx Not Rotating Logs

 Problem

As of Kasm Workspace version 1.15.0+ , the kasm_proxy nginx container fails to rotate logs. This can lead to excessive disk usage over time.

 


 Solution

Apply the following commands on each Kasm server with the affect versions.

sudo mkdir /opt/kasm/current/conf/logrotate sudo vi /opt/kasm/current/conf/logrotate/logrotate.conf # paste the following content into that file ^ /var/log/external/nginx/*.log { su nginx adm size 10k missingok rotate 20 compress delaycompress notifempty sharedscripts postrotate if [ -f /var/run/nginx.pid ]; then kill -USR1 `cat /var/run/nginx.pid` nginx -s reload fi endscript } # end file content sudo vi /opt/kasm/current/docker/docker-compose.yaml # Edit this file ^, add a volume mapping to the proxy container proxy: container_name: kasm_proxy image: "kasmweb/nginx:1.25.3" ports: - "443:443" networks: - kasm_default_network volumes: - /opt/kasm/1.15.0/conf/logrotate/logrotate.conf:/etc/logrotate.conf:ro sudo docker rm -f kasm_proxy sudo /opt/kasm/bin/start # Test that rotation is working sudo docker exec -it kasm_proxy /usr/sbin/logrotate -v /etc/logrotate.conf ls -l /opt/kasm/current/log/nginx

 

 

 


 

Impacted Versions:

Issues were first observed on the following versions, but may impact other versions as well.

  • 1.15.0+

Resolved Versions:

The issue is no longer applicable for the following and newer versions.

  • None

Related Docs:

  • None

 Related articles

  • None

 

Related content