Created
February 7, 2017 03:40
-
-
Save bitmage/8e7a56cb1c493456345a85b044276ff6 to your computer and use it in GitHub Desktop.
Replace ENV variables in an nginx config. Minimal solution - a perl one liner!
This file contains 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
#!/bin/sh | |
perl -pe 's/\$\{([^}]+)\}/defined $ENV{$1} ? $ENV{$1} : die("Missing env variable: $1")/eg' \ | |
< /src/proxy-redirect.conf >/etc/nginx/conf.d/nginx.conf \ | |
&& nginx -g 'daemon off;' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment