Docker Community Forums

I’m facing wired behavior of Swarm. I’ve formed 3 node Swarm cluster on my laptop and run single service with 3 replicas. When calling the service via my laptop browser I always get routed to the same service. However, if I ssh to one of the Swarm nodes and run curl I get RR load balanced each and every request.
I was expecting that my requests from the browser will be RR load balanced as well.

Run simple web service to return the Swarm node host name on which the task is running:
docker service create --name web --replicas 3 --mount type=bind,src=/etc/hostname,dst=/usr/share/nginx/html/index.html,readonly --publish 80:80 nginx

Login to one of the Swarm nodes and run:
curl 192.168.72.128
Result: Each time the respond is from different task

Open browser and type one of the Swarm nodes URL. For example:http://192.168.72.11
Result: Each and every browser respond with the same task answering the request