Last active
June 23, 2016 07:36
-
-
Save ecstasy2/dd659d9e1de16ffa7a9b60cd946f490a to your computer and use it in GitHub Desktop.
Used to bootstrap nginx proxy for developer stacks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Download and install configuration" | |
STACK=`curl -s http://rancher-metadata/latest/self/stack/name` | |
export STACK | |
echo "Running in stack $STACK" | |
curl -L -H 'Cache-Control: no-cache' https://gist.githubusercontent.com/ecstasy2/b03381ca42d1df394decb14582cd8726/raw > /tmp/services.conf | |
cat /tmp/services.conf | envsubst '$STACK' | tee /etc/nginx/conf.d/services.conf | |
curl -L -H 'Cache-Control: no-cache' https://gist.githubusercontent.com/ecstasy2/74da089e617f6e9211dd00146054cfb1/raw > /etc/nginx/proxy_params | |
chown nginx:nginx /etc/nginx/conf.d/services.conf | |
chown nginx:nginx /etc/nginx/proxy_params | |
echo "Resulting config" | |
cat /etc/nginx/conf.d/services.conf | |
echo "Starting nginx" | |
nginx -g 'daemon off;' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We use this script to bootstrap nginx after having downloaded the correct configuration.