Hi,
I recently added a new webservice in my stack.
I added the labels for traefik as I did in the past, but somehow, it's not working well.
It's nextcloud. The app opens the port 8080 inside the docker and maps it to 8089.
I can access nextcloud through the server_local_ip:8089
But through mydomain, I get a "bad gateway message"
"connection refused".
Every other subdomains are accessible.
The container opens 8080 as default inside, I map it to 8089, and for the loadbalancer I put 8080, but I'm really not sure about what I am doing there.
If it is correct, then how to manage different containers that have the same inner port exposed, because then the label will be pointing at the same ports ?
This is really confusing.
Should I put those conflicting containers on different networks ?
I welcome any help, explanation or pointers.
Cheers.
on top of it traefik container was also causing issues with that
traefik > label > traefik.http.services.api.loadbalancer.server.port=8083
traefik > label > traefik.port=8083
traefik > ports > 80:80
traefik > ports > 443:443
I finally tried to solve this by changing the inner apache port of app 2, using permanent volumes for default.conf and ports.conf.
Changed them to 8089, and applied 8089 in the app2 label for the load balancer port
The loadbalancer.server.port should be the port inside the target container. You do not need to expose the port externally (except for Traefik itself). Traefik will route to the target via the Docker network to the internal port.