Created
March 29, 2016 14:13
-
-
Save andergmartins/0cdcc710adcd96732977 to your computer and use it in GitHub Desktop.
How to use nginx as proxy to set virtual hosts for docker containers
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
# From: http://stackoverflow.com/questions/18497564/assigning-vhosts-to-docker-ports | |
# start the reverse proxy | |
docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock jwilder/nginx-proxy | |
# start a first container for http://tutum.test.local | |
docker run -d -e "VIRTUAL_HOST=tutum.test.local" tutum/hello-world | |
# start a second container for http://deis.test.local | |
docker run -d -e "VIRTUAL_HOST=deis.test.local" deis/helloworld |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment