From affe19378be83b71d371fe4c7a5d95aed8447afc Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Mon, 9 Jun 2025 10:22:31 +0300 Subject: [PATCH] image-entry: improve NGX_HTTP_STATIC_MERGE behavior --- image-entry.d/70-merge-dirs.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/image-entry.d/70-merge-dirs.sh b/image-entry.d/70-merge-dirs.sh index 42caa4e..56909ae 100755 --- a/image-entry.d/70-merge-dirs.sh +++ b/image-entry.d/70-merge-dirs.sh @@ -5,6 +5,9 @@ set -ef ## hack: override "cache", "lib" and "log" from /angie (and possibly from /etc/angie) fake_dir=$(mktemp -d) +if [ "${NGX_HTTP_STATIC_MERGE}" = 0 ] ; then + persist_dirs="${persist_dirs} static" +fi for n in ${persist_dirs} ; do touch "${fake_dir}/$n" ; done install -d "${target_root}" @@ -18,7 +21,6 @@ if [ "${NGX_HTTP_STATIC_MERGE}" = 0 ] ; then src0=/etc/angie.dist/static dst="${target_root}/static" - rm -rf "${dst}" for r in /angie /etc/angie ; do src="$r/static" [ -d "${src}" ] || continue @@ -29,6 +31,7 @@ if [ "${NGX_HTTP_STATIC_MERGE}" = 0 ] ; then install -d "${dst}" overlaydirs --merge "${dst}" ${src0} "${src}" + break done [ -d "${dst}" ] || { log_always "static directory is almost empty!"