[GH-ISSUE #126] How to collect access logs? #112

Closed
opened 2026-02-26 05:34:39 +03:00 by kerem · 10 comments
Owner

Originally created by @ck003 on GitHub (Apr 23, 2019).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/126

Hello , Thanks for your sharing . How can I collect access logs because I want to know who have accessed my server , and I want to know their IP address, please help

Originally created by @ck003 on GitHub (Apr 23, 2019). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/126 Hello , Thanks for your sharing . How can I collect access logs because I want to know who have accessed my server , and I want to know their IP address, please help
kerem 2026-02-26 05:34:39 +03:00
Author
Owner

@ck003 commented on GitHub (Apr 23, 2019):

@jc21

<!-- gh-comment-id:485629229 --> @ck003 commented on GitHub (Apr 23, 2019): @jc21
Author
Owner

@kolbii commented on GitHub (Apr 23, 2019):

Not sure, but I think you can mount a host directory to /var/log/nginx. For instance:
docker run -d
--name nginx-proxy-manager-app
-p 80:80
-p 81:81
-p 443:443
-v /path/to/config.json:/app/config/production.json
-v /path/to/logs:/var/log/ninx
-v /path/to/data:/data
-v /path/to/letsencrypt:/etc/letsencrypt
jc21/nginx-proxy-manager:latest-armhf

<!-- gh-comment-id:485919415 --> @kolbii commented on GitHub (Apr 23, 2019): Not sure, but I think you can mount a host directory to /var/log/nginx. For instance: docker run -d \ --name nginx-proxy-manager-app \ -p 80:80 \ -p 81:81 \ -p 443:443 \ -v /path/to/config.json:/app/config/production.json \ -v /path/to/logs:/var/log/ninx \ -v /path/to/data:/data \ -v /path/to/letsencrypt:/etc/letsencrypt \ jc21/nginx-proxy-manager:latest-armhf
Author
Owner

@jc21 commented on GitHub (Apr 23, 2019):

The access logs for each host created by NPM is available in the data directory you should be mounting. eg data/logs/proxy_host-10.log

<!-- gh-comment-id:485977741 --> @jc21 commented on GitHub (Apr 23, 2019): The access logs for each host created by NPM is available in the `data` directory you should be mounting. eg `data/logs/proxy_host-10.log`
Author
Owner

@ncm-lfc commented on GitHub (Nov 7, 2019):

Any idea where I can find these log files in Hassio addon?

<!-- gh-comment-id:551035708 --> @ncm-lfc commented on GitHub (Nov 7, 2019): Any idea where I can find these log files in Hassio addon?
Author
Owner

@b2az commented on GitHub (Jun 23, 2020):

@ncm-lfc searching for the same. Have you found the logs?

<!-- gh-comment-id:647933918 --> @b2az commented on GitHub (Jun 23, 2020): @ncm-lfc searching for the same. Have you found the logs?
Author
Owner

@jonasrubensson commented on GitHub (Jul 16, 2020):

@ncm-lfc @b2az Did you find them?

<!-- gh-comment-id:659309096 --> @jonasrubensson commented on GitHub (Jul 16, 2020): @ncm-lfc @b2az Did you find them?
Author
Owner

@lordfiSh commented on GitHub (Mar 6, 2021):

@jonrub @ncm-lfc @b2az you most likely don't need the info anymore, but logs are mapped to Supervisor Nginx Proxy Manager
Log Tab: (https://github.com/hassio-addons/addon-nginx-proxy-manager/blob/main/proxy-manager/rootfs/etc/cont-init.d/npm.sh)

<!-- gh-comment-id:792076993 --> @lordfiSh commented on GitHub (Mar 6, 2021): @jonrub @ncm-lfc @b2az you most likely don't need the info anymore, but logs are mapped to Supervisor Nginx Proxy Manager Log Tab: (https://github.com/hassio-addons/addon-nginx-proxy-manager/blob/main/proxy-manager/rootfs/etc/cont-init.d/npm.sh)
Author
Owner

@b2az commented on GitHub (Oct 15, 2021):

@lordfiSh yes thx sorted it out already :)

<!-- gh-comment-id:944437417 --> @b2az commented on GitHub (Oct 15, 2021): @lordfiSh yes thx sorted it out already :)
Author
Owner

@graig123 commented on GitHub (Mar 5, 2022):

Any one looking to use ngxtop for access log monitoring and not having any luck.

I changes the conf file genarated by NPM for my host ( location: /data/nginx/proxy_host filename will be 1.conf | or similar)
Inside it there is a line:
access_log /data/logs/proxy-host-1_access.log proxy;
changed it to:
access_log /data/logs/proxy-host-1_access.log;

ngxtop can procces log after this change.

<!-- gh-comment-id:1059785725 --> @graig123 commented on GitHub (Mar 5, 2022): Any one looking to use **ngxtop** for access log monitoring and not having any luck. I changes the conf file genarated by NPM for my host ( location: /data/nginx/proxy_host filename will be 1.conf | or similar) Inside it there is a line: `access_log /data/logs/proxy-host-1_access.log proxy;` changed it to: `access_log /data/logs/proxy-host-1_access.log;` ngxtop can procces log after this change.
Author
Owner

@8OND007 commented on GitHub (Sep 7, 2024):

did you get it working ? I can't seem to find the path where the log file is stored.

did you found a solution to redirect the access log somewhere ?
I would like to use a GoAccess for nginx proxy manager addon/docker to view a website portal with statistics.
using this: https://github.com/xavier-hernandez/goaccess-for-nginxproxymanager

I did not found a HA addon for it, but I can make it with Portainer en paste a docker compose text there in the "Add Stack".

If I look at the Nginx Reverse Proxy Manager Addon with Portainer, I see following Volume mappings:
image|690x199

indeed the /mnt/data/supervisor/addon_configs/a0d7b954_nginxproxymanager is under my HA samba share undder addon_configs:

image|621x444

but the other share is not under addons directory (it is empty).

Anyone got GoAccess working with the HA NPM addon logs ?

edit: I think the logs are stored with HA under /var/log/journal ? (binary files)

with :
ha host logs --identifier addon_a0d7b954_nginxproxymanager
under supervsor ssh you can also see the log of the NPM.
Question now how to add this to the GoAccess docker compose file Volumes?

below something I tought it would be, but log is not available as file I think.

version: '3.3'
services:
goaccess:
image: 'xavierh/goaccess-for-nginxproxymanager:latest'
container_name: goaccess
restart: always
ports:
- '7880:7880'
environment:
- TZ=Europe/Brussels
- SKIP_ARCHIVED_LOGS=False #optional
- DEBUG=False #optional
- BASIC_AUTH=False #optional
- BASIC_AUTH_USERNAME=user #optional
- BASIC_AUTH_PASSWORD=pass #optional
- EXCLUDE_IPS=127.0.0.1 #optional - comma delimited
- LOG_TYPE=NPM #optional - more information below
- ENABLE_BROWSERS_LIST=True #optional - more information below
- CUSTOM_BROWSERS=Kuma:Uptime,TestBrowser:Crawler #optional - comma delimited, more information below
- HTML_REFRESH=5 #optional - Refresh the HTML report every X seconds. https://goaccess.io/man
- KEEP_LAST=30 #optional - Keep the last specified number of days in storage. https://goaccess.io/man
- PROCESSING_THREADS=1 #optional - This parameter sets the number of concurrent processing threads in the program's execution, affecting log data analysis, typically adjusted based on CPU cores. Default is 1. https://goaccess.io/man
volumes:
- /mnt/data/supervisor/addons/data/a0d7b954_nginxproxymanager/logs:/opt/log
- /path/to/host/custom:/opt/custom #optional, required if using log_type = CUSTOM
networks:
- nginxproxymanager_default

networks:
nginxproxymanager_default:
external: true

<!-- gh-comment-id:2335147505 --> @8OND007 commented on GitHub (Sep 7, 2024): did you get it working ? I can't seem to find the path where the log file is stored. did you found a solution to redirect the access log somewhere ? I would like to use a GoAccess for nginx proxy manager addon/docker to view a website portal with statistics. using this: https://github.com/xavier-hernandez/goaccess-for-nginxproxymanager I did not found a HA addon for it, but I can make it with Portainer en paste a docker compose text there in the "Add Stack". If I look at the Nginx Reverse Proxy Manager Addon with Portainer, I see following Volume mappings: ![image|690x199](upload://6G6ObaypNxZDXyObqSYq1akKW16.png) indeed the /mnt/data/supervisor/addon_configs/a0d7b954_nginxproxymanager is under my HA samba share undder addon_configs: ![image|621x444](upload://zY95e6fIVkSsrhRBaWL6ZdD7gko.png) but the other share is not under addons directory (it is empty). Anyone got GoAccess working with the HA NPM addon logs ? edit: I think the logs are stored with HA under /var/log/journal ? (binary files) with : ha host logs --identifier addon_a0d7b954_nginxproxymanager under supervsor ssh you can also see the log of the NPM. Question now how to add this to the GoAccess docker compose file Volumes? below something I tought it would be, but log is not available as file I think. version: '3.3' services: goaccess: image: 'xavierh/goaccess-for-nginxproxymanager:latest' container_name: goaccess restart: always ports: - '7880:7880' environment: - TZ=Europe/Brussels - SKIP_ARCHIVED_LOGS=False #optional - DEBUG=False #optional - BASIC_AUTH=False #optional - BASIC_AUTH_USERNAME=user #optional - BASIC_AUTH_PASSWORD=pass #optional - EXCLUDE_IPS=127.0.0.1 #optional - comma delimited - LOG_TYPE=NPM #optional - more information below - ENABLE_BROWSERS_LIST=True #optional - more information below - CUSTOM_BROWSERS=Kuma:Uptime,TestBrowser:Crawler #optional - comma delimited, more information below - HTML_REFRESH=5 #optional - Refresh the HTML report every X seconds. https://goaccess.io/man - KEEP_LAST=30 #optional - Keep the last specified number of days in storage. https://goaccess.io/man - PROCESSING_THREADS=1 #optional - This parameter sets the number of concurrent processing threads in the program's execution, affecting log data analysis, typically adjusted based on CPU cores. Default is 1. https://goaccess.io/man volumes: - /mnt/data/supervisor/addons/data/a0d7b954_nginxproxymanager/logs:/opt/log - /path/to/host/custom:/opt/custom #optional, required if using log_type = CUSTOM networks: - nginxproxymanager_default networks: nginxproxymanager_default: external: true
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#112
No description provided.