nginx-log-viewer displays nginx access logs over http. All (uncompressed and gzipped) access logs are compiled in to a single webpage, filterable by IP or accessed resource.
These instructions have been tested on Ubuntu 16.04, but should work on any Debian Linux.
$ git clone https://github.com/hinfaits/nginx-log-viewer.git
$ cd nginx-log-viewer/
$ pip3 install --user -r requirements.txt
$ python3 runserver.py
Navigate to http://127.0.0.1:8181/
Basic GeoIP lookups can be done via MaxMind.To enable lookups
- Download the MaxMind GeoLite2 City database
- Extract the database. On Ubuntu:
gzip -d GeoLite2-City.mmdb.gz
- Run nginx-log-viewer using
python runserver.py -G /path/to/GeoLite2-City.mmdb
- If logs are not in the default nginx format,
parse_log_line()
innginx_log_viewer/utils.py
may require editing. - The author does not recommend running nginx-log-viewer on the open web as efforts to secure the application have been minimal.