Welcome to the Nginx Proxy Manager Graf project! This tool integrates Nginx Proxy Manager logs with Grafana, allowing you to visualize your web traffic through beautiful dashboards. Utilize geographical data to analyze requests and monitor the performance of your web services in real-time.
Before you get started, there are a few things you need to have in place:
- InfluxDB Setup: Create a database named
nginxproxymanagergraf
in InfluxDB to store the logs. - Authentication: Create a username and password for accessing the
nginxproxymanagergraf
database. - GeoLite2-City Database: Obtain the
GeoLite2-City.mmdb
file for IP geolocation. You can find this by searching online. Once obtained, upload it to a location accessible by the Docker container. - Docker: Ensure Docker is installed on the host where the Nginx Proxy Manager runs.
Run the following Docker command on the same host where the Nginx Proxy Manager is running. Replace the placeholders with your actual data, such as the InfluxDB username, password, and the path to the GeoLite2-City.mmdb
file.
docker run --name npmgraf -it \
-v /home/docker/nginx-proxy-manager/data/logs:/logs \
-v /path/to/your/GeoLite2-City.mmdb:/GeoLite2-City.mmdb \
-e HOME_IPS="192.168.0.*|192.168.10.*" \
-e INFLUX_USER=<Your_InfluxDB_Username> -e INFLUX_PW=<Your_InfluxDB_Password> \
-e INFLUX_DB=nginxproxymanagergraf \
-e INFLUX_HOST=<Your_InfluxDB_Host> \
-e INFLUX_PORT=8086 \
makarai/nginx-proxy-manager-graf
After starting the Docker container, add InfluxDB as a data source in Grafana:
- Open Grafana and navigate to Configuration > Data Sources.
- Click Add data source, then select InfluxDB.
- Fill in the details for your InfluxDB instance, including the database
nginxproxymanagergraf
, user, and password you created earlier.
To visualize the Nginx Proxy Manager logs:
- In Grafana, go to + > Import.
- Upload the dashboard JSON file or enter the ID if it's hosted online.
- Select the InfluxDB data source you added in the previous step.
Once the dashboard is set up, you can start exploring your data. The world map visualization can be achieved with a query like:
SELECT count("IP") AS "counts" FROM "ReverseProxyConnections" WHERE $timeFilter GROUP BY "latitude", "longitude", "IP"
- Customize your dashboards to focus on the metrics that matter most to you.
- Regularly update the GeoLite2 database to ensure accurate geolocation data.
- Explore Grafana's alerting features to get notified of unusual traffic patterns or performance issues.
For more details on Nginx Proxy Manager, visit the official GitHub page.
Screenshot of a Grafana dashboard visualizing Nginx Proxy Manager data.