1
0

image-entry: improve NGX_HTTP_STATIC_MERGE behavior

This commit is contained in:
2025-06-09 10:22:31 +03:00
parent 0e515abaec
commit affe19378b

View File

@@ -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!"