Automatically detect running docker containers and redirect http traffic to them depending on the url.
I have a pi that runs pihole and other non-public services. I want to set nice names for these services in the pihole dns and just start docker containers. I guess jwilder/nginx-proxy does something similar, although I haven't really looked at it.
- search all running containers for the tag
goreverse
and parse the value as a url - get the public port that is mapped to private port 80
- proxy requests sent to the public port 80 of the machine to the private port of the matching container
- profit
- the resolved url is set in the host header
- nginx
- reverse proxy already sets
X-Forwarded-For
- Ealenn/Echo-Server is nice for manual testing:
docker run --rm -p 80 -l goreverse=http://kek.com -d ealen/echo-server
- accept https and terminate ssl
- listen on docker event channel and update on demand
- tests lul