Merge pull request #9 from wagesj45/codex/update-readme.md-with-nginx-sample-config

Add Nginx sample config
This commit is contained in:
Jordan Wages 2025-07-18 00:28:36 -05:00 committed by GitHub
commit 78c0727677
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -49,3 +49,31 @@ Use the `run-reports.sh` script to run all report intervals in one step. The scr
Running this script will create or update the hourly, daily, weekly and monthly reports under `output/`.
## Serving Reports with Nginx
To expose the generated HTML dashboards and JSON files over HTTP you can use a
simple Nginx server block. Point the `root` directive to the repository's
`output/` directory and optionally restrict access to your local network.
```nginx
server {
listen 80;
server_name example.com;
# Path to the generated reports
root /path/to/ngxstat/output;
location / {
try_files $uri $uri/ =404;
}
# Allow access only from private networks
allow 192.0.0.0/8;
allow 10.0.0.0/8;
deny all;
}
```
With this configuration the generated static files are served directly by
Nginx while connections outside of `192.*` and `10.*` are denied.