nginx / Apache

How to Analyze nginx Access Logs for Security Threats

What’s in a combined access log line

A standard nginx/Apache combined log line packs the client IP, timestamp, HTTP method and path, status code, response size, referer, and user-agent into one line:

203.0.113.7 - - [16/Jun/2026:03:00:00 +0000] "POST /api/v1/login HTTP/1.1" 401 287 "-" "python-requests/2.31"

Every field matters for security analysis, but none of them are dangerous in isolation — 401 happens constantly for legitimate reasons, and python-requests is a completely normal user-agent for a developer’s integration test. The signal is in the combination and the volume, not any single field.

What to look at first

  1. Status code distribution per IP. A normal user produces a healthy mix of 200s with occasional 404s. A scanner produces almost all 404s with the rare 200 standing out. A credential-stuffing bot produces a wall of 401s, sometimes ending in a 200.
  2. Request rate and timing variance. Humans are irregular. Scripts are suspiciously regular, or suspiciously fast.
  3. User-agent strings. Not as a blocklist — context is everything. curl hitting your public status page is nothing; curl hitting /api/v1/admin/users is a different story entirely.
  4. Path sensitivity. Know which of your endpoints are sensitive (auth, admin, data export) before you start reading logs, so you’re not treating every 404 on a typo’d marketing URL with the same urgency as a probe against /api/v1/admin.
  5. Referer and origin consistency. Legitimate browser traffic almost always carries a referer for non-entry-point pages; most scripted attack traffic doesn’t bother.

Common patterns and what they mean

PatternLikely meaning
Many 401s, one 200, same pathCredential stuffing / brute force
Many distinct paths, mostly 404, one 200Reconnaissance — they found something
UNION SELECT / ' OR 1=1 in query stringSQL injection attempt
Very high request rate, narrow path setAPI scraping
200 responses with abnormally large sizePossible data exfiltration in progress

Where manual log review breaks down

Reading nginx logs line by line works for one suspicious request. It does not work for correlating thousands of lines across multiple IPs, cross-referencing source IPs against current threat intelligence, or scoring which of fifty simultaneous anomalies is actually the one worth an analyst’s attention first. That correlation step — not the log format itself — is the actual bottleneck in most manual log review processes.

LogTriage parses nginx logs automatically, enriches every IP against live threat intelligence (AbuseIPDB, OTX, GreyNoise, ThreatFox), classifies user-agents and path sensitivity in context, and produces a single risk-ranked report instead of a wall of raw lines.

Frequently Asked Questions

What's the minimum information a combined log format line provides for security analysis?
Client IP, timestamp, HTTP method, request path, status code, response size, referrer, and user-agent. Every one of these matters in combination. The status code in isolation is nearly useless; combined with the request path, rate from a single IP, and user-agent string, those same fields produce high-confidence attack detection.
How do I analyze nginx logs if they're rotated across multiple files?
LogTriage accepts individual log files up to 100 MB. For rotated logs spread across multiple files covering the same incident window, LogTriage's multi-file investigation feature lets you correlate findings across uploads rather than concatenating files manually.
Can I use LogTriage with Apache access logs as well as nginx?
Yes. LogTriage's parser handles both nginx and Apache combined log format — they use the same combined log format. The parser auto-detects this format regardless of whether the server was nginx or Apache.
What's the most common reason a manual nginx log review misses an attack?
Volume and correlation. A single malicious line looks exactly like noise. The attack signal is in the pattern across hundreds or thousands of lines — the same IP, the same path, the same status code sequence — which is straightforward to detect algorithmically and nearly impossible to spot reliably when reading a file manually.

Related Resources

See this detection run on a real report

Try the live demo with a pre-loaded malicious log set — no signup required — or upload your own log file and get a full AI-reviewed threat report in minutes.