1
0
angie-conv-image/image-entry.d/21-http-modules.envsh

47 lines
1005 B
Plaintext
Raw Normal View History

2024-07-15 16:15:47 +03:00
#!/bin/sh
if [ "${NGX_HTTP}" = 1 ] ; then
2024-07-23 21:59:49 +03:00
unset http_modules http_confload
2024-07-15 16:15:47 +03:00
http_modules=
2024-07-23 21:59:49 +03:00
http_confload="${NGX_HTTP_CONFLOAD:-}"
2024-07-15 16:15:47 +03:00
2024-07-17 13:50:13 +03:00
if [ -n "${NGX_HTTP_MODULES}" ] ; then
## angie-module-lua: depends on angie-module-ndk
## angie-module-set-misc: depends on angie-module-ndk
NGX_HTTP_MODULES=$(
printf '%s' "${NGX_HTTP_MODULES}" \
| sed -zE 's/(\s|^)(lua|set-misc)(\s|$)/\1ndk \2\3/g'
)
fi
2024-07-15 16:15:47 +03:00
## filter out builtin http modules
unset i
for i in ${NGX_HTTP_MODULES:-} ; do
[ -n "$i" ] || continue
if is_builtin_module http "$i" ; then
2024-07-23 21:59:49 +03:00
log "$i is builtin module, moving to confload"
http_confload="${http_confload} $i"
2024-07-15 16:15:47 +03:00
continue
fi
## naive deduplication
case " ${http_modules} " in
*" $i "* )
log "$i is already specified"
continue
;;
esac
http_modules="${http_modules}${http_modules:+ }$i"
done
unset i
set -a
NGX_HTTP_MODULES="${http_modules}"
2024-07-23 21:59:49 +03:00
NGX_HTTP_CONFLOAD=$(sort_dedup_list "${http_confload}")
2024-07-15 16:15:47 +03:00
set +a
2024-07-23 21:59:49 +03:00
unset http_modules http_confload
2024-07-15 16:15:47 +03:00
fi