Container communication in multi-host swarm

I am trying to start a multihost swarm.on Centos using proxy

The containers are able to communicate with one another without any issues when they are on a single host. But if they are spread across the hosts, they fail to communicate.

However this failure is isolated to application related connectivity only.

I use docker-compose V3 to deploy a stack with multiple services on multihost setup.

If I have my tomcat container (C1) on host (H1) and my mysql container (C2) on host (H2). The the following works :

  1. I am able to ping C2 from C1 using the service name specified in my docker-compose file. This properly resolves to the overlay network IP range

  2. I am also able to telnet to port 3306 of C2 from C1 and am able to see the overlay IP of the foriegn host on my C2 netstat.

  3. I have a test page on C1 which is accessible from C2 via curl on port 80

However the following doesnt work (unless I keep both containers C1 and C2 in the same host H1/H2)

  1. I am unable to view the test page from C1 on C2 via port 443 (https using curl - also tried with -k )

  2. The tomcat container (C1) is unable to communicate with mysql (C2) when jdbc tries the connection string.

Additonal Notes :

I am able to run the same multihost setup on another environment without proxy.

Hence is this an issue with proxy?

Does this have to do with enableing ipv6/ipv4 with relation to the proxy.

Any pointers will be helpful.