mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-08-07 09:53:38 +00:00
Add CrowdSec OpenResty bouncer config - ENV: CROWDSEC_BOUNCER = 1 to enable. /data/crowdsec/crowdsec-openresty-bouncer.conf is the configuration file for it.
Add Admin dashboard logging to the /data/logs/admin-panel_[access/error].log folder - ENV: ADMIN_PANEL_LOG = 1 to enable. Add OpenResty error log (fallback_error.log) debug level - ENV: OPENRESTY_DEBUG = 1 to enable.
This commit is contained in:
29
docker/rootfs/etc/cont-init.d/98_logging-options.sh
Executable file
29
docker/rootfs/etc/cont-init.d/98_logging-options.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
set -e # Exit immediately if a command exits with a non-zero status.
|
||||
set -u # Treat unset variables as an error.
|
||||
|
||||
# Redirect admin panel logs from /dev/null to log files if enabled
|
||||
if [[ ${ADMIN_PANEL_LOG} == "1" ]] || [[ ${ADMIN_PANEL_LOG} -eq 1 ]]; then
|
||||
echo "Enabling admin dashboard logging"
|
||||
echo "ADMIN_PANEL_LOG = $ADMIN_PANEL_LOG"
|
||||
sed-patch 's|<ADMIN_ACCESS_LOG>|/data/logs/admin-panel_access.log standard|' /etc/nginx/conf.d/production.conf
|
||||
sed-patch 's|<ADMIN_ERROR_LOG>|/data/logs/admin-panel_error.log warn|' /etc/nginx/conf.d/production.conf
|
||||
else
|
||||
echo "Leaving admin dashboard logging off (default behavior)"
|
||||
echo "ADMIN_PANEL_LOG = $ADMIN_PANEL_LOG"
|
||||
sed-patch 's|<ADMIN_ACCESS_LOG>|/dev/null|' /etc/nginx/conf.d/production.conf
|
||||
sed-patch 's|<ADMIN_ERROR_LOG>|/dev/null|' /etc/nginx/conf.d/production.conf
|
||||
fi
|
||||
|
||||
if [[ ${OPENRESTY_DEBUG} == "1" ]] || [[ ${OPENRESTY_DEBUG} -eq 1 ]]; then
|
||||
echo "Changing OpenResty ERROR (fallback_error.log) logging to level: DEBUG"
|
||||
echo "OPENRESTY_DEBUG = $OPENRESTY_DEBUG"
|
||||
sed-patch 's|<ERROR_LOG_LEVEL>|debug|' /etc/nginx/nginx.conf
|
||||
|
||||
else
|
||||
echo "Leaving OpenResty ERROR (fallback_error.log) logging at level: WARN (default behavior)"
|
||||
echo "OPENRESTY_DEBUG = $OPENRESTY_DEBUG"
|
||||
sed-patch 's|<ERROR_LOG_LEVEL>|warn|' /etc/nginx/nginx.conf
|
||||
fi
|
Reference in New Issue
Block a user