#!/bin/sh # Default to HTTP if PROTOCOL is not set PROTOCOL="${PROTOCOL:-http}" # Replace placeholders with environment variable values envsubst '$BACKEND_ADDRESS $BACKEND_PORT $PROTOCOL' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf # Use envsubst to replace environment variables in nginx.conf.template and output to nginx.conf #envsubst '$BACKEND_ADDRESS,$BACKEND_PORT' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf # Start nginx in the foreground exec nginx -g 'daemon off;'