diff --git a/bin/eval-config b/bin/eval-config new file mode 100755 index 00000000..ef62547b --- /dev/null +++ b/bin/eval-config @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +CONFIG_ROOT="${NGINX_CONFIG_ROOT:=config}" +CONFIG_FILE="${NGINX_CONFIG_FILE:=nginx.conf.erb}" + +# Evaluate config to get $PORT +erb $CONFIG_ROOT/$CONFIG_FILE > config/nginx.conf \ No newline at end of file diff --git a/bin/start-nginx b/bin/start-nginx index dbf19062..1e8655c2 100755 --- a/bin/start-nginx +++ b/bin/start-nginx @@ -4,8 +4,7 @@ psmgr=/tmp/nginx-buildpack-wait rm -f $psmgr mkfifo $psmgr -# Evaluate config to get $PORT -erb config/nginx.conf.erb > config/nginx.conf +./eval-config n=1 while getopts :f option ${@:1:2} diff --git a/bin/start-nginx-debug b/bin/start-nginx-debug index 8a6b0912..9a795f83 100755 --- a/bin/start-nginx-debug +++ b/bin/start-nginx-debug @@ -4,8 +4,7 @@ psmgr=/tmp/nginx-buildpack-wait rm -f $psmgr mkfifo $psmgr -# Evaluate config to get $PORT -erb config/nginx.conf.erb > config/nginx.conf +./eval-config n=1 while getopts :f option ${@:1:2} diff --git a/bin/start-nginx-solo b/bin/start-nginx-solo index f8eccd99..0ff1d820 100755 --- a/bin/start-nginx-solo +++ b/bin/start-nginx-solo @@ -4,8 +4,7 @@ psmgr=/tmp/nginx-buildpack-wait rm -f $psmgr mkfifo $psmgr -# Evaluate config to get $PORT -erb config/nginx.conf.erb > config/nginx.conf +./eval-config n=1 while getopts :f option ${@:1:2}