Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description


A Docker container that distributes HTTP and HTTPS requests to other containers on the same system.

Configuration and Usage

docker-web-proxy uses the metadata from Docker to configure nginx proxies. To do this, it reads env vars off of other containers within your Docker instance. Currently, it's hard-coded to only use a Unix socket that must be exposed with -v.

Start docker-web-proxy with the following:

docker run -p 80:80 -p 443:443 -v /var/run/docker.sock:/var/run/docker.sock -v /storage/ssl:/srv/ssl --rm eropple/docker-web-proxy

It'll immediately begin scanning for containers and update its internal configuration.

Proxy Configuration

docker-web-proxy is configured through the setting of environment variables. Currently it understands only one environment variable:

  • PROXY_REFRESH_TIME defines, in seconds, how rapidly Docker should be polled for configuration changes. The default is 5, but depending on your use cases, dropping this to 1 may make sense.

SSL certificates should be volumed to /srv/ssl. Their naming convention is given under Endpoint Configuration, below.

Endpoint Configuration

Endpoints should likewise be configured with environment variables as below:

  • VHOST defines the hostname that should route to the decorated container.
  • PORT defines the port on the container to route to. (Defaults to 80.)
  • HTTP and HTTPS may both be set to 1 or 0 and are used to turn SSL on or off. If both are set to 1, HTTP requests will be forwarded to HTTPS. (This behavior currently cannot be changed.)
  • HTTPS_KEY_NAME defines a custom key name that will be found within the directory volumed to /srv/ssl. This defaults to the hostname if not set (for example, to use a wildcard certificate without having many copies in the directory). nginx will look for /srv/ssl/$HTTPS_KEY_NAME.crt and /srv/ssl/$HTTPS_KEY_NAME.key, as appropriate.


docker-web-proxy is released under the Apache License, version 2.0.

Thanks To

Docker Pull Command
Source Repository