get overview of web sites access from nginx logs. both in linux console and as a web page
https://goaccess.io/download#distro
goaccess /var/log/nginx/access.log --log-format=VCOMBINED
/etc/nginx/nginx.conf
log_format vcombined '$host:$server_port ' '$remote_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent"'; access_log /var/log/nginx/access.log vcombined;
nginx static page
crontab -e
* * * * * goaccess /var/log/nginx/access.log --log-format=VCOMBINED -a -o /var/www/html/index.html
vi /etc/nginx/sites-available/stat.conf
server { listen 80; server_name goaccess.example.com; root /var/www/html/; location / { index index.html; } }
switch log rotation to monthly so page contain more data (if size of logs allows that)
vi /etc/logrotate.d/nginx
/var/log/nginx/*.log { monthly missingok rotate 3 notifempty create 640 nginx adm sharedscripts postrotate if [ -f /var/run/nginx.pid ]; then kill -USR1 `cat /var/run/nginx.pid` fi endscript }