40 lines
784 B
Plaintext
40 lines
784 B
Plaintext
|
#!/bin/sh
|
||
|
|
||
|
if [ "${NGX_HTTP}" = 1 ] ; then
|
||
|
unset http_modules http_snippets
|
||
|
http_modules=
|
||
|
http_snippets="${NGX_HTTP_SNIPPETS:-}"
|
||
|
|
||
|
## filter out builtin http modules
|
||
|
unset i
|
||
|
for i in ${NGX_HTTP_MODULES:-} ; do
|
||
|
[ -n "$i" ] || continue
|
||
|
|
||
|
if is_builtin_module http "$i" ; then
|
||
|
log "$i is builtin module, moving to snippets"
|
||
|
http_snippets="${http_snippets}${http_snippets:+ }$i"
|
||
|
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
|
||
|
|
||
|
http_snippets=$(sort_dedup_list "${http_snippets}")
|
||
|
|
||
|
set -a
|
||
|
NGX_HTTP_MODULES="${http_modules}"
|
||
|
NGX_HTTP_SNIPPETS="${http_snippets}"
|
||
|
set +a
|
||
|
|
||
|
unset http_modules http_snippets
|
||
|
fi
|