Přejít na menu

Nginx automated proxy for Docker

Správa článků

Vyhledávání Vyhledávání
8.11.2015 20:46
,
Počet přečtení: 596
How to run the Docker container which automatically proxies your container URL aliases to the appropriate containers.

Author's post about the ngproxy, GitHub page with manual

Let's run!

  1. Run the nginx-proxy container.
    Bind it to the port 80 on localhost and it will monitor all other containers (using /var/run/docker.sock file)
    $ docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy
  2. Run your custom container with VIRTUAL_HOST parameter:
    nginx-proxy container will notice it and will actualize its settings to point your alias to this container.
    $ docker run -e VIRTUAL_HOST=my-container.local my-image
  3. Point the alias to the localhost in /etc/hosts
    127.0.0.1 my-container.local
Vytvořil 8. listopadu 2015 ve 21:04:46 mira. Záznam nebyl nikdy upravován.


Diskuze ke článku

Vložení nového komentáře
*
*
*