Your site suddenly feels slow, pages take forever to load, and you have no idea whether a post went viral or a bot is hammering your server. The answer is already sitting on your VPS: the Nginx access log records every single request. Learning to monitor nginx access logs with GoAccess turns that wall of text into a live dashboard you can read in seconds, and the tool itself is free and open source.
GoAccess reads your existing log files and builds a report in the terminal or as an HTML page. There is no agent to install, no database to run, and no monthly fee. If you can read a log line, you can use it. This guide walks through installing it, opening a live dashboard, and using it to spot a traffic spike while it is still happening.
What GoAccess Shows That Raw Logs Hide
A raw access log is one line per request: IP address, time, requested URL, status code, user agent. One busy hour can produce tens of thousands of those lines, and tail alone will not tell you much. GoAccess groups those lines into panels you can scan at a glance: unique visitors, most requested files, status code breakdown, top referrers, browsers, and the IP addresses sending the most requests.
That grouping is what makes nginx log analysis useful in practice. Instead of grepping for one URL at a time, you see the shape of the traffic: which page is getting hit, where the visitors came from, and whether the load is spread across many addresses or concentrated on a handful. When something goes wrong, that shape points you at the cause in under a minute.
Before you start, it helps to know where your logs live and what each line means. If you have never opened them, read our guide on where Nginx access and error logs live and how to read them first so the paths and log format make sense.
Install GoAccess on Your VPS
On Ubuntu and Debian, GoAccess is one package away:
sudo apt update
sudo apt install goaccess
That is the whole install. GoAccess reads logs directly from disk, so it works with the log format Nginx writes by default. On most systems the combined log format is already the default in /etc/nginx/nginx.conf, and the log file sits at /var/log/nginx/access.log. If your server block writes logs somewhere else, point GoAccess at that path instead.
Run a first one-off report against yesterday’s log to see what it looks like:
goaccess /var/log/nginx/access.log --log-format=COMBINED
GoAccess opens an interactive terminal dashboard. Use the arrow keys to move between panels and press q to quit. If it complains about the log format, your Nginx setup may use a custom format. Check the access_log line in your server block and match it with the --log-format option or a small config file at ~/.goaccessrc.
How to Monitor Nginx Access Logs in Real Time
The terminal view is fine for a quick look, but the real strength of GoAccess is its live HTML report. This command builds a report that refreshes itself as new requests arrive:
goaccess /var/log/nginx/access.log -o /var/www/html/goaccess.html --log-format=COMBINED --real-time-html --ws-url=wss://example.com:7890
Open https://example.com/goaccess.html in your browser and the goaccess real-time dashboard updates every second or so. The --real-time-html flag starts a small WebSocket server on port 7890 by default, which pushes updates to the page. Put the report behind basic auth or an IP allowlist, since it exposes your traffic details to anyone who finds the URL.
For a quick terminal session during an incident, run GoAccess in follow mode instead:
goaccess /var/log/nginx/access.log --log-format=COMBINED --real-time-html --daemonize
Either way, the habit that matters is the same: when the site feels slow, open the dashboard before you start restarting services. Guessing wastes time. The log shows whether the load is real visitors, one aggressive IP, or a flood of 404s from a broken link.
Reading the Dashboard During a Traffic Spike
When traffic jumps, work through the panels in this order. First, look at unique visitors and total requests over time. A genuine spike shows both climbing together. If requests climb but unique visitors stay flat, a small number of clients is generating most of the load.
Next, check the requested files panel. One URL taking most of the hits points at a popular post, a hotlinked image, or an endpoint being abused. A flat spread across many URLs looks more like normal growth or a crawler working through your sitemap.
Then look at status codes. A healthy spike is mostly 200s. A flood of 404s means something is probing URLs that do not exist, and a rise in 500s means your backend is struggling. Pair this with error log monitoring: our guide on monitoring Nginx error logs and alerting on 5xx spikes covers the other half of the picture.
Finally, check the hosts panel. A few IPs with thousands of requests each are worth a closer look, while hundreds of IPs with a few requests each is normal traffic. Cross-check CPU and memory while you are at it. If the server itself is saturated, read our walkthrough on monitoring disk, RAM, and CPU usage with htop and glances before you change any Nginx settings.
Real Spike or Bot Flood? How to Tell
Goaccess traffic spike detection comes down to a few patterns in the panels. A real spike has varied IP addresses, real browsers in the user agent list, a referrer you can recognize (a social network, a search engine, a news site), and most requests aimed at one or two popular pages.
A bot flood looks different. One or two IPs send a huge share of requests, user agents are missing, generic, or claim to be ancient browsers, and the requested URLs are a strange mix: admin paths, WordPress login pages, random query strings, or the same file requested hundreds of times a second. Referrers are usually blank.
When the pattern points at bots, rate limiting is the right first response. Our guide on rate limiting Nginx to stop brute-force and scraping bots shows how to slow abusive clients down without blocking real visitors. For a single bad IP, a temporary block in your firewall buys time while you decide on a permanent rule. Do not block whole countries or user agents on a hunch; check the log first and block what the log actually shows.
Automate a Daily HTML Report
A live dashboard is great during an incident, but a daily report catches slow trends you would otherwise miss. A single cron job rebuilds a static HTML report from the previous day’s log each morning:
0 6 * * * goaccess /var/log/nginx/access.log.1 -o /var/www/html/goaccess-yesterday.html --log-format=COMBINED --anonymize-ip
The --anonymize-ip flag masks visitor IP addresses in the report, which is sensible if anyone else on your team reads it. Keep the report in a protected directory, not your public web root, unless you are comfortable sharing traffic details.
Skim the daily report for three things: the top requested URLs, the top referrers, and any IP that stands out. A URL climbing day after day is a post gaining traction. A new referrer you do not recognize is worth one click to check. An IP that appears at the top three days in a row deserves a look at what it is requesting.
Keep Your Logs from Filling the Disk
GoAccess is only as good as the logs it reads, and busy sites produce large logs fast. A server that logs every request without rotation will eventually run out of disk, and a full disk takes MySQL and PHP down with it. Ubuntu ships with logrotate configured for Nginx by default, but check that it is actually running:
ls -lh /var/log/nginx/
cat /etc/logrotate.d/nginx
You should see dated archives like access.log.1 and compressed older files, plus a config that rotates daily and keeps a couple of weeks. If rotation is missing or broken, fix it before you lean on GoAccess for daily reports. Our guide on setting up log rotation before logs fill the disk walks through the config step by step.
One more caution: GoAccess reads whatever the log contains, including query strings. If your application logs sensitive data in URLs, such as password reset tokens, that data appears in the report too. Keep reports private and clean up old ones when you no longer need them.
Start with the live dashboard today, while traffic is normal, so you know what a healthy day looks like. When the next spike arrives, you will recognize it in seconds instead of guessing, and the log will already hold the answer to what caused it.