Guides
Reading logs and block reasons
By the end of this page you can find in the logs why a request was blocked and go to the settings that control that cause. You also know what to check when logs stop appearing.
Before you start
- Your role needs permission to read logs.
- If a proxy such as Cloudflare sits in front of NPG, set up Settings → Trusted Proxies first, or the logs record the proxy's address instead of the visitor's. (Running behind Cloudflare)
The log tabs
Logs in the top menu has these tabs.
| Tab | Contents |
|---|---|
| Access Logs | Every HTTP request that went through the proxy. Blocked requests are here too, with a Block Reason. |
| WAF Events | Requests that matched WAF rules: rule ID, message, and whether they were blocked. |
| Bot Filter | Requests the bot filter blocked, with the bot category |
| Exploit Blocks | Requests the Block Exploits rules blocked, with the rule name |
| Stream | Sessions of TCP/UDP stream hosts: client IP, protocol, status, bytes sent, session time, backend |
| System Logs | NPG's own activity |
| Admin Audit | Who changed which setting, and when |
| Raw Files | Rotation and retention of the raw log files nginx writes, and downloads |

Block reasons
The Block Reason in Access Logs tells you which NPG feature blocked a request. The Block Reason filter groups requests by cause.
| Block reason | Feature that blocked it | Where to change it |
|---|---|---|
WAF | ModSecurity WAF | When the WAF blocks legitimate requests |
Exploit | Block Exploits | WAF / Blocking → Exploit Block Rules |
Bot Filter | Bot filter | The host's Security tab, or WAF / Blocking → Global Bot Filter |
Geo Block | GeoIP restriction | The host's Security tab, or Global GeoIP |
Cloud | Cloud provider blocking | The host's Security tab, or Global Cloud Blocking |
Banned IP | Manual bans, Fail2ban, WAF Auto-Ban | WAF / Blocking → IP Ban Management |
URI Block | URI block rules | WAF / Blocking → URI Block Management |
Access Denied | Access list | Access Control → Access Lists |
Filter | Filter subscriptions | Settings → Filter Subscriptions |
Rate Limit | NPG's rate limit | The host's Protection tab, or Global Rate Limit |
To exempt an address from these blocks, see Trusted IPs, exceptions and precedence.
Log details
Clicking a row opens Log Details.
- The Block Reason section at the top adds detail for the cause: rule ID and attack type for the WAF, the rule name for Exploit, the bot category for the bot filter, the matched URI for URI blocks. For a filter subscription block it shows which subscription and which entry matched, and lists separately any disabled subscription that holds the same entry.
- Client Info has the IP, the GeoIP location (country, city, ASN, organization), the User Agent and the Referer.
- Request Time and Upstream Server are shown, plus the Retry path if there were retries.
- Raw Log shows the line nginx wrote, as written.
- From this screen you can ban the IP, block the URI or exclude a WAF rule directly.

Log collection rules
Requests that are frequent but not worth keeping, such as WebDAV sync PROPFINDs or health checks, can be left out of storage.
- Click the Collection rules button in the Logs → Access Logs toolbar.
- Find the host, click Edit, and fill in Status codes (for example
207, 3xx), Methods (for examplePROPFIND, OPTIONS) and Paths starting with (one per line). To leave out all of a host's logs, turn on Don't store this host's access logs. Stream hosts have Don't store this host's sessions. - Click Save.

Requests that match a rule are not stored, so they are missing from the logs and statistics. Requests NPG blocks and WAF events are always stored regardless of the rules, and Fail2ban still counts every request. Path rules do not apply while Strip query string from access log under Settings → Global Settings → Advanced is on.
Raw log files
Logs → Raw Files sets rotation and retention for the raw files nginx writes (/etc/nginx/logs/access_raw.log, and stream_raw.log for streams), and lets you preview or download them.
- Max File Size (MB): checked every hour; a file larger than this is rotated. Files are also rotated every day at midnight regardless of size.
- Retention Period (days): rotated files older than this are deleted at the next rotation.
- Compress Rotated Files: compresses with gzip to save disk space.

How long logs are kept in the database is set with Retention Period (days) in Log Settings on the log screen.
Check that it works
- Open a proxy host in a browser, then check that the request appears in Access Logs. Collection lags by a few seconds.
- To try a block, run WAF / Blocking → WAF Tester against a host with the WAF on and check that WAF Events records it.
When no logs appear
- Check the search conditions. Look for a date range, host or Exclude Filters (NOT) that hides the rows. Excluding status code 403 also hides requests the WAF blocked.
- Check the collection rules. A host set to store nothing, or a path rule, keeps its requests out of storage.
- See whether the raw file grows. If
access_raw.loggrows under Raw Files but nothing appears on screen, the problem is in the API's collection step. Look forLogCollectorerrors indocker logs npg-api. - HTTPS requests leave no record at all. An HTTPS connection whose domain (SNI) matches no proxy host is refused during the TLS handshake, so no HTTP log line is written. Check that the domain is registered on a proxy host.
- Only WAF Events is empty. Many hostile requests are stopped earlier at the nginx level by country blocking, the bot filter, banned IPs or Block Exploits. Look at the Block Reason in Access Logs as well. Whether the host's WAF is on can be checked with WAF Tester.
Things that are easy to misread
- A 429 whose block reason is not
Rate Limit. NPG's rate limit blocks before the request reaches the backend, so Upstream Server is empty. A 429 with Upstream Server filled in was returned by the backend itself. - A WebSocket request with a very long request time. For a row with status 101, Request Time is how long the connection stayed open. It does not mean the response was slow.
- Every client IP is the same private or CDN address. Settings → Trusted Proxies is not set up, or Real IP header does not match the header the proxy in front sends.