-
Hi all,
When i try to reach the whoami container through nginx, i get an error like :
When i try to reach the whoami container on his publish port (8001), it's ok :
The problem is that nginx try to reach container via ingress network, not on the dedicated overlay (attachable) network (my-network) i setup before. We can see that it refers to the wrong network (ingress) in nginx configuration file :
Here is my stack definition :
I don't know why nginx cannot join whoami container on the IP 10.0.0.254, and why i can't use my-network. Did you know what i have to do to nginx proxy works in swarm mode ? Docker versions : 20.10.5+dfsg1 |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
What happens if you change expose:
- "8000" |
Beta Was this translation helpful? Give feedback.
-
@rhansen, it works :
I have to understand why (probably the fact that : "ports will be accessible by other services connected to the same network" |
Beta Was this translation helpful? Give feedback.
-
If you use |
Beta Was this translation helpful? Give feedback.
-
Thank you all ! |
Beta Was this translation helpful? Give feedback.
-
Finally, all my container didn't specify "ports" nor "expose" in docker-compose (stack - except nginx with ports 80 and 443). They did not have addresses in ingress network (except nginx even in 1.2.1 version it works), they all have an address in private overlay network of course (even nginx of course). And it's ok for all. It's pretty perfect for me. |
Beta Was this translation helpful? Give feedback.
What happens if you change
ports:
toexpose:
on yourwhoami
service (but not yournginx-proxy
service), like this: