nginx-proxy: Add an Nginx proxy image
authorW. Trevor King <wking@tremily.us>
Fri, 3 Jan 2014 03:39:54 +0000 (19:39 -0800)
committerW. Trevor King <wking@tremily.us>
Sat, 4 Jan 2014 01:02:50 +0000 (17:02 -0800)
commit06db3b33d62887af7f003efdf87b57ee4d1bea08
tree32fad14b275040032767940f4aa6a0da3c31b7ad
parentbcd4feeb1eef696e13ef958f6d31f6bdd3b8d9fe
nginx-proxy: Add an Nginx proxy image

I've got a bunch of HTTP server images, but I need a single proxy
container that supports SNI to expose them to the world.  This
container can link to a colleciton of HTTP-serving containers and
proxy them under arbitrary hostnames using user-supplied, per-host
certificates and keys.

env and sed are both in POSIX 2013 [1,2], and the:

  eval A=\$$B

variable indirection is because POSIX [3] doesn't support Bash's
indirect expansion "A=${!B}".  The 'tcp' -> 'http' replacement maps
Docker's tcp:://${IP}:${PORT} addresses to http://${IP}:${PORT} for
use in the Nginx config.

envsubst is in gettext [4] and not in POSIX [5], so it may be slightly
less portable.  However, envsubst and gettext are in Gentoo's x86 and
amd64 stage1s, our Gentoo-based images will have it.

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/env.html
[2]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html
[3]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02
[4]: http://www.gnu.org/software/gettext/
[5]: http://pubs.opengroup.org/onlinepubs/9699919799/idx/utilities.html
README.md
build.sh
nginx-proxy/Dockerfile.template [new file with mode: 0644]
nginx-proxy/README.md [new file with mode: 0644]
nginx-proxy/create-vhosts-from-environment.sh [new file with mode: 0755]
nginx-proxy/vhost-template.conf [new file with mode: 0644]