From 7b1bc522f66aadd84945046ea879668bd39cbd18 Mon Sep 17 00:00:00 2001 From: Michael Hobbs Date: Wed, 27 Apr 2016 11:56:50 -0700 Subject: [PATCH] export app config vars into sigil environment for use in nginx templates. closes #2149 --- docs/nginx.md | 2 ++ plugins/nginx-vhosts/functions | 1 + 2 files changed, 3 insertions(+) diff --git a/docs/nginx.md b/docs/nginx.md index 957beeb18..645a9a22a 100644 --- a/docs/nginx.md +++ b/docs/nginx.md @@ -69,6 +69,8 @@ server { {{ .SSL_SERVER_NAME }} List of SSL VHOSTS ``` +> NOTE: Application config variables are available for use in custom templates. To do so, use the form of `{{ var "FOO" }}` to access a variable named `FOO`. + ### Example HTTP to HTTPS Custom Template Use case: a simple dockerfile app that includes `EXPOSE 80` diff --git a/plugins/nginx-vhosts/functions b/plugins/nginx-vhosts/functions index dfd43486a..2992244a1 100755 --- a/plugins/nginx-vhosts/functions +++ b/plugins/nginx-vhosts/functions @@ -188,6 +188,7 @@ nginx_build_config() { fi local SSL_SERVER_NAME=$(echo "$SSL_VHOSTS" | xargs) fi + eval "$(config_export app "$APP")" local SIGIL_PARAMS=(-f $NGINX_TEMPLATE APP="$APP" DOKKU_ROOT="$DOKKU_ROOT" NOSSL_SERVER_NAME="$NOSSL_SERVER_NAME" DOKKU_APP_LISTENERS="$DOKKU_APP_LISTENERS"