Docker nginx-proxy round robin…

nginx + docker
docker + nginx

So we use docker for container services at work. One container that is part of our ‘dev’ tools is an nginx reverse proxy tied to port 80. IT allows us to run many projects at once using hostnames and port 80; just like in production.

So we are chugging along and I start an applications http service. Hit the service in the browser, all good, reload: broken, reload: good, reload: broken. I am all like wait a minute, thats not cool. After about 5 minutes of debugged we make a realization: I have two instances of the http service running.

Turns out the nginx reverse proxy round robins requests when more than one service is running.

*Note: This was all done w/o docker swarm enabled. Just plain docker-compose and docker run where used.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.