Get the default configuration file nginx for nginx, optimized for Ubuntu 16.04 LTS (Xenial Xerus). This example configuration ensures optimal compatibility and performance for nginx, making it easy to set up and adjust to meet your needs.
Find and download the configuration file here: /etc/logrotate.d/nginx.
For more configurations and setup guides, visit our related files section to further customize your system.
/var/log/nginx/*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 0640 www-data adm
sharedscripts
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi \
endscript
postrotate
invoke-rc.d nginx rotate >/dev/null 2>&1
endscript
}
Download the raw file with wget or curl
wget -O nginx.example https://exampleconfig.com/static/raw/nginx/ubuntu16.04/etc/logrotate.d/nginx
curl https://exampleconfig.com/static/raw/nginx/ubuntu16.04/etc/logrotate.d/nginx > nginx.example
Other config files you might find useful