Files
medassist-ng/frontend/nginx-entrypoint.sh
T
Daniel Volz cefac8cc4e fix: nginx proxy buffering warnings and LOG_LEVEL propagation (#229)
- Increase proxy buffer sizes to prevent upstream image responses being
  buffered to temporary files (16k header + 8x256k body + 512k busy)
- Add env_file to frontend service in docker-compose.dev.yml for LOG_LEVEL
- Normalize LOG_LEVEL in nginx-entrypoint.sh (case-insensitive, trim whitespace)
- Add startup logging showing LOG_LEVEL → access_log mapping

Closes #226
2026-02-16 21:52:03 +01:00

27 lines
970 B
Bash
Executable File

#!/bin/sh
# =============================================================================
# Frontend entrypoint wrapper
# Translates LOG_LEVEL into nginx access log control before
# delegating to the standard nginx-unprivileged entrypoint.
#
# LOG_LEVEL=debug|info → access logs enabled (default)
# LOG_LEVEL=warn|error|fatal|silent → access logs suppressed
# =============================================================================
# Normalize: lowercase + trim whitespace
level=$(printf '%s' "${LOG_LEVEL:-info}" | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]')
case "$level" in
warn|error|fatal|silent)
export NGINX_ACCESS_LOG="off"
echo "[nginx-entrypoint] LOG_LEVEL=${LOG_LEVEL} → access_log off"
;;
*)
export NGINX_ACCESS_LOG="/dev/stdout"
echo "[nginx-entrypoint] LOG_LEVEL=${LOG_LEVEL:-info} → access_log /dev/stdout"
;;
esac
# Delegate to the original nginx-unprivileged entrypoint
exec /docker-entrypoint.sh "$@"