Skip to content

Commit a341d2a

Browse files
authored
Update entrypoint.sh
1 parent 0c39fdb commit a341d2a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

entrypoint.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,22 @@ for MAPPING in "${MAPPING_LIST[@]}"; do
4747
echo " Port: $PROXY_PORT"
4848
fi
4949

50+
# Determine which template to use
51+
CUSTOM_TEMPLATE="/app/${PROXY_HOST}.${PROXY_PORT}.conf"
52+
DEFAULT_TEMPLATE="/app/default.conf.template"
53+
54+
if [ -f "$CUSTOM_TEMPLATE" ]; then
55+
TEMPLATE="$CUSTOM_TEMPLATE"
56+
echo "Using custom template: $TEMPLATE"
57+
else
58+
TEMPLATE="$DEFAULT_TEMPLATE"
59+
echo "Using default template: $TEMPLATE"
60+
fi
61+
5062
# Use envsubst to produce a .conf per domain
5163
envsubst '$PROXY_DOMAIN,$PROXY_HOST,$PROXY_PORT' \
52-
< /app/default.conf.template \
53-
> "/etc/nginx/conf.d/${PROXY_DOMAIN}.conf"
64+
< "$TEMPLATE" \
65+
> "/etc/nginx/conf.d/${PROXY_DOMAIN}.conf"
5466

5567
# -------------------------
5668
# Issue or Install SSL Cert

0 commit comments

Comments
 (0)