diff --git a/CHANGELOG.md b/CHANGELOG.md index 58c6a13b4..3c8558497 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed - Use per request configuration when cache is disabled [PR #289](https://github.com/3scale/apicast/pull/289) +- Automatically expose all environment variables starting with `APICAST_` or `THREESCALE_` to nginx [PR #292](https://github.com/3scale/apicast/pull/292) ### Added diff --git a/apicast/bin/apicast b/apicast/bin/apicast index fee777416..c600735f8 100755 --- a/apicast/bin/apicast +++ b/apicast/bin/apicast @@ -110,6 +110,7 @@ done main+=("daemon ${daemon};") main+=("worker_processes ${worker_processes};") +main+=$(printenv | awk '$1 ~ /^(APICAST|THREESCALE)_/ {split($0,env,"="); print "env", env[1] ";"}') function join_by { local IFS="$1"; shift; echo "$*"; } args=$(join_by '' "${args[@]}") diff --git a/apicast/conf/nginx.conf b/apicast/conf/nginx.conf index 82c099a06..d8523030c 100644 --- a/apicast/conf/nginx.conf +++ b/apicast/conf/nginx.conf @@ -1,20 +1,8 @@ -env THREESCALE_DEPLOYMENT_ENV; -env THREESCALE_PORTAL_ENDPOINT; -env THREESCALE_CONFIG_FILE; -env APICAST_CUSTOM_CONFIG; -env APICAST_PATH_ROUTING_ENABLED; -env APICAST_SERVICES; env REDIS_HOST; env REDIS_PORT; env RESOLVER; -env APICAST_MODULE; -env APICAST_RESPONSE_CODES; -env APICAST_MANAGEMENT_API; env BACKEND_ENDPOINT_OVERRIDE; -env APICAST_CONFIGURATION_LOADER; -env APICAST_CONFIGURATION_CACHE; - include ../main.d/*.conf; error_log /dev/null emerg;