mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 09:25:55 +03:00
[GH-ISSUE #126] How to collect access logs? #112
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#112
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
@ck003 commented on GitHub (Apr 23, 2019):
@jc21
@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
@jc21 commented on GitHub (Apr 23, 2019):
The access logs for each host created by NPM is available in the
datadirectory you should be mounting. egdata/logs/proxy_host-10.log@ncm-lfc commented on GitHub (Nov 7, 2019):
Any idea where I can find these log files in Hassio addon?
@b2az commented on GitHub (Jun 23, 2020):
@ncm-lfc searching for the same. Have you found the logs?
@jonasrubensson commented on GitHub (Jul 16, 2020):
@ncm-lfc @b2az Did you find them?
@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)
@b2az commented on GitHub (Oct 15, 2021):
@lordfiSh yes thx sorted it out already :)
@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.
@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:

indeed the /mnt/data/supervisor/addon_configs/a0d7b954_nginxproxymanager is under my HA samba share undder addon_configs:
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