Nginx Access Log Analysis Checklist for Bot Traffic

halfbrain_logo512adminJune 12, 2026
170 lượt xem

Nginx Access Log Analysis Checklist for Bot Traffic

Nginx access logs show who requested your website, which URLs were hit, what status codes were returned and how often requests happened. This is useful for finding aggressive bots, crawl waste, suspicious traffic and overloaded URLs.

What to look for

  • Too many requests from one IP.
  • Repeated hits to wp-login.php.
  • Repeated 404 URLs.
  • Suspicious query strings.
  • Heavy bot traffic from unknown user agents.
  • Requests that trigger 502 or 504 errors.

Checklist

  1. Locate the access log file.
  2. View recent requests.
  3. Find IPs with high request counts.
  4. Find URLs requested most often.
  5. Check status codes like 404, 500, 502 and 504.
  6. Check requests to wp-login.php and xmlrpc.php.
  7. Look for suspicious query strings.
  8. Compare access log with error log.
  9. Block abusive IPs only after confirming behavior.
  10. Document recurring bot patterns.

Final check

Access log analysis helps you stop guessing. It shows traffic patterns that may explain slow websites, server overload and security problems.

Checklist Type Log Analysis
Level Intermediate
Risk Level Medium Risk
Estimated Time 30–60 minutes

When to Use This Checklist

Use this checklist when your website is slow, overloaded or receiving suspicious bot traffic.

Required Tools

SSH access, Nginx access log, Nginx error log, awk, sort, uniq, firewall access

Before You Start

Do not block IPs blindly. First confirm the traffic pattern and make sure the IP is not a legitimate service or search engine.

Verification Steps

  1. Top abusive IPs are identified.
  2. Heavy URLs are known.
  3. Status code patterns are understood.
  4. Any firewall block is documented.
  5. Server load is checked after mitigation.

Rollback Plan

If a firewall rule blocks legitimate traffic, remove the rule and use more specific conditions such as path-based protection or rate limiting.

Common Mistakes

  • Blocking Googlebot by mistake.
  • Only reading error log and ignoring access log.
  • Not checking status codes.
  • Confusing high traffic with attack.
  • No documentation of blocked IPs.

Related Commands

sudo tail -n 100 /var/log/nginx/access.log
sudo awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -nr | head
sudo awk '{print $7}' /var/log/nginx/access.log | sort | uniq -c | sort -nr | head
sudo tail -n 100 /var/log/nginx/error.log

Share:

Disclaimer: The guides, checklists, commands, and examples on HalfBrain.net are provided for educational and operational reference only. Server environments, hosting providers, software versions, security settings, and WordPress configurations can vary, so you should always review commands before running them on your own system. We do our best to keep the content accurate and useful, but we cannot guarantee that every command, configuration, or recommendation will fit every environment. Always back up your website, database, and server configuration before making changes. HalfBrain.net is not responsible for data loss, downtime, security incidents, misconfiguration, or other issues that may result from applying the information on this website. Use the material at your own discretion.

Leave a Reply

Your email address will not be published. Required fields are marked *