Skip to content

Instantly share code, notes, and snippets.

@hgirish
Last active March 16, 2026 19:16
Show Gist options
  • Select an option

  • Save hgirish/70d101de830a56410035df6e5b67ed02 to your computer and use it in GitHub Desktop.

Select an option

Save hgirish/70d101de830a56410035df6e5b67ed02 to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
# Substitute environment variables into nginx.conf
envsubst '${PRIMARY_DOMAIN} ${ALIAS_DOMAINS}' \
< /etc/nginx/conf.d/nginx.conf.template \
> /etc/nginx/conf.d/default.conf
nginx -g "daemon off;"
DEV
PRIMARY_DOMAIN=dev-primary-domain.com
ALIAS_DOMAINS="dev-alias1.com dev-alias2.com"
PROD
PRIMARY_DOMAIN=prod-primary-domain.com
ALIAS_DOMAINS="prod-alias1.com prod-alias2.com"
QA
PRIMARY_DOMAIN=qa-primary-domain.com
ALIAS_DOMAINS="qa-alias1.com qa-alias2.com"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment