2014-12-18 10:49:13 +01:00
|
|
|
# Automated Nginx reverse Proxy for Docker Webservices
|
2015-01-22 11:34:41 +01:00
|
|
|
This image attaches to the docker event queue and creates/removes proxy settings in the contained nginx.
|
2014-12-18 10:49:13 +01:00
|
|
|
|
2015-01-22 11:34:41 +01:00
|
|
|
## Starting the container
|
|
|
|
The container is started as:
|
2015-01-26 20:26:54 +01:00
|
|
|
|
2015-01-22 11:34:41 +01:00
|
|
|
`docker run --name auto_proxy -d -v /var/run/docker.sock:/var/run/docker.sock -p 80:80 docker_nginx_auto_proxy`
|
2015-01-26 20:26:54 +01:00
|
|
|
|
2015-01-22 11:34:41 +01:00
|
|
|
The socket must be handed in so the container can get the events.
|
2015-01-08 07:48:34 +01:00
|
|
|
|
|
|
|
## How it works
|
2015-01-22 11:34:41 +01:00
|
|
|
Containers that should be proxied neet meta information in the environment variable *PROXY_DATA* available.
|
|
|
|
This variable must be of the following format:
|
2015-01-26 20:26:54 +01:00
|
|
|
|
2015-01-22 11:34:41 +01:00
|
|
|
`PROXY_DATA=server_name:test.com,port:80`
|
|
|
|
|
|
|
|
The following options are possible:
|
|
|
|
|
|
|
|
* **server_name**(required) the name of the virtual host
|
|
|
|
* **port**(optional, defaults to 80) the port on the target container
|
|
|
|
* **ip**(optional, defaults to listen on all IPs) the IP on which the proxy should listen.
|
|
|
|
* **location**(optional) if the proxied web application is not running on the /-path
|