migrated core_nest to mainroom
This commit is contained in:
23
mainroom/ctrl/server/nginx/generate-config.sh
Executable file
23
mainroom/ctrl/server/nginx/generate-config.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
# Generate nginx config based on ENABLE_WRAPPER env var
|
||||
|
||||
TEMPLATE="/etc/nginx/templates/docker-local.conf.template"
|
||||
OUTPUT="/etc/nginx/conf.d/default.conf"
|
||||
|
||||
# Start with the template
|
||||
cp "$TEMPLATE" "$OUTPUT"
|
||||
|
||||
# If ENABLE_WRAPPER is not true, remove wrapper injection
|
||||
if [ "$ENABLE_WRAPPER" != "true" ]; then
|
||||
echo "Wrapper disabled - removing injection lines"
|
||||
sed -i '/wrapper/d' "$OUTPUT"
|
||||
sed -i '/sub_filter/d' "$OUTPUT"
|
||||
sed -i '/Accept-Encoding/d' "$OUTPUT"
|
||||
fi
|
||||
|
||||
# Replace env vars
|
||||
envsubst '${DEPLOYMENT_NAME} ${NEST_NAME} ${MANAGED_DOMAIN} ${PAWPRINT_DOMAIN}' < "$OUTPUT" > /tmp/nginx.conf
|
||||
mv /tmp/nginx.conf "$OUTPUT"
|
||||
|
||||
echo "Nginx config generated (ENABLE_WRAPPER=$ENABLE_WRAPPER)"
|
||||
cat "$OUTPUT"
|
||||
Reference in New Issue
Block a user