Three containers share the stats network. counter exited and proxy on port 8081 returns 502. Both point at localhost.
text
host :8081 ──► proxy ──► counter :8080 ──► redis :6379See what failed:
sh
docker logs counterRecreate the counter so it finds Redis by name:
sh
docker rm counter
docker run -d --name counter --network stats -p 8080:8080 -e REDIS_HOST=redis stackmonsters/visit-counter:1.0
curl -s localhost:8080Now the proxy. Read its log and config:
sh
curl -s localhost:8081
docker logs proxy
cat ~/proxy/default.conf~/proxy is bind-mounted at /etc/nginx/conf.d. Change proxy_pass to http://counter:8080; with nano ~/proxy/default.conf, then restart nginx so it reads the new config:
sh
docker restart proxy
curl -s localhost:8081