{"action":"created","issue":{"url":"https://api.github.com/repos/mholt/caddy/issues/199","labels_url":"https://api.github.com/repos/mholt/caddy/issues/199/labels{/name}","comments_url":"https://api.github.com/repos/mholt/caddy/issues/199/comments","events_url":"https://api.github.com/repos/mholt/caddy/issues/199/events","html_url":"https://github.com/mholt/caddy/issues/199","id":97153042,"number":199,"title":"Support to reverse proxy into Docker Containers","user":{"login":"redbeard0x0a","id":299470,"avatar_url":"https://avatars.githubusercontent.com/u/299470?v=3","gravatar_id":"","url":"https://api.github.com/users/redbeard0x0a","html_url":"https://github.com/redbeard0x0a","followers_url":"https://api.github.com/users/redbeard0x0a/followers","following_url":"https://api.github.com/users/redbeard0x0a/following{/other_user}","gists_url":"https://api.github.com/users/redbeard0x0a/gists{/gist_id}","starred_url":"https://api.github.com/users/redbeard0x0a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redbeard0x0a/subscriptions","organizations_url":"https://api.github.com/users/redbeard0x0a/orgs","repos_url":"https://api.github.com/users/redbeard0x0a/repos","events_url":"https://api.github.com/users/redbeard0x0a/events{/privacy}","received_events_url":"https://api.github.com/users/redbeard0x0a/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mholt/caddy/labels/suggestion","name":"suggestion","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-07-24T21:42:02Z","updated_at":"2015-11-10T05:59:46Z","closed_at":null,"body":"A useful feature that would be good to use Caddy as the frontend server in front of 1+ Docker Hosts (or Docker Swarm). \r\n\r\nThe caddy configuration file would have one or more docker hosts specified so that specifically tagged/named docker container instances running on those hosts could be looked up based on the Host header requested via HTTP. When a request comes in, take the Host header and do a lookup (full, partial or regex) against the Docker API to match the Host header to a Docker Instance running on the docker hosts (load balancing if multiple instances are running). \r\n\r\nThis would make it easy to launch docker containers that are configured in a specific way (i.e. a container tagged as dockerhubacct/www.example.com -or- via environment variables). There are many different ways this could be setup, container names need to be unique per docker host, but tags and environment variables do not.\r\n\r\n**Docker Proxy - Possible Caddyfile Directives**\r\n\r\n```\r\ndocker_proxy / dockerhost1 dockerhost2 {\r\n  # Use the same things as a normal proxy. docker_proxy would just be a smarter proxy module\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/mholt/caddy/issues/comments/155305469","html_url":"https://github.com/mholt/caddy/issues/199#issuecomment-155305469","issue_url":"https://api.github.com/repos/mholt/caddy/issues/199","id":155305469,"user":{"login":"captncraig","id":192540,"avatar_url":"https://avatars.githubusercontent.com/u/192540?v=3","gravatar_id":"","url":"https://api.github.com/users/captncraig","html_url":"https://github.com/captncraig","followers_url":"https://api.github.com/users/captncraig/followers","following_url":"https://api.github.com/users/captncraig/following{/other_user}","gists_url":"https://api.github.com/users/captncraig/gists{/gist_id}","starred_url":"https://api.github.com/users/captncraig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/captncraig/subscriptions","organizations_url":"https://api.github.com/users/captncraig/orgs","repos_url":"https://api.github.com/users/captncraig/repos","events_url":"https://api.github.com/users/captncraig/events{/privacy}","received_events_url":"https://api.github.com/users/captncraig/received_events","type":"User","site_admin":false},"created_at":"2015-11-10T05:59:46Z","updated_at":"2015-11-10T05:59:46Z","body":"I feel like the ideal for this would be some api to the proxy module that allows you to change the downstreams at runtime. Restarting the entire server seems tricky, and there are a lot of possible use cases for reconfiguring the downstream servers. \r\n\r\nIt would be nice if either a custom middleware, or an outside application could change the set of proxied servers without a full restart."}}