Setup Goaccess
Editing Nginx Configuration
sudo nano /etc/nginx/nginx.confย http {
log_format combined_log '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
# ... (rest of the configuration)
}http {
map $remote_addr $anonymized_addr {
~(?P<ip>\d+\.\d+)\.\d+\. $ip.0.0;
~(?P<ip>[^:]+:[^:]+): $ip::;
# IP addresses to not anonymize (such as your server)
127.0.0.1 $remote_addr;
::1 $remote_addr;
#w.x.y.z $remote_addr;
#a::c:d::e:f $remote_addr;
default 0.0.0.0;
}
log_format combined_log '$anonymized_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
access_log /var/log/nginx/access.log combined_log;
# ... (rest of the configuration)
}Testing and Reloading Nginx Configuration
Configuring Log Rotation
Setting Up GoAccess for Web Traffic Monitoring
Last updated
Was this helpful?