# Help with labels for duplicate containers in the same stack

**URL:** <https://community.traefik.io/t/help-with-labels-for-duplicate-containers-in-the-same-stack/26887>\
**Category:** Traefik v3 (latest)\
**Tags:** docker\
**Created:** [March 16, 2025, 7:06pm UTC](https://community.traefik.io/t/help-with-labels-for-duplicate-containers-in-the-same-stack/26887 "2025-03-16T19:06:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bobsdacool](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/bobsdacool/32/10140_2.png) [@bobsdacool](https://community.traefik.io/u/bobsdacool)\
**Post date:** [March 16, 2025, 7:06pm UTC](https://community.traefik.io/t/help-with-labels-for-duplicate-containers-in-the-same-stack/26887/1 "2025-03-16T19:06:19Z")

</div>

Hi all.

Hoping someone can give me a bit of a hand here. I'm running traefik in docker and I've two instances of sftpgo that I'd like to run. One for local storage, and one for exposed storage. I've wracked through the setup that I have here, but can't figure out what I've got wrong. My instance of sftpgo is reachable, however my instance of stpgotwo is not reachable with an error 404. Traefik and traefik UI logs don't show any errors for these, and they are reachable when the ports are exposed on my machine.

I'm really not sure what to do so any help is much appreciated.

containers are communicating also, just as a heads up.

Here are my docker compose layouts.

sftpgo:  
container\_name: sftpgo  
restart: always  
user: ####:####  
volumes:  
- type: bind  
source: ####  
target: /srv/sftpgo  
- type: bind  
source: ####  
target: /var/lib/sftpgo  
environment:  
- SFTPGO\_WEBDAVD\_\_BINDINGS\_\_0\_\_PORT=81  
image: 'drakkan/sftpgo:latest'  
networks:  
- traefik  
labels:  
- traefik.enable=true  
- traefik.docker.network=network\_traefik  
- traefik.http.routers.sftpgo.entrypoints=web  
- traefik.http.routers.sftpgo.service=sftpgo  
- traefik.http.services.sftpgo.loadbalancer.server.port=8080  
- traefik.http.routers.sftpgo.rule=Host("sftpgo.####")  
- traefik.http.routers.sftpgo-secure.entrypoints=websecure  
- traefik.http.routers.sftpgo-secure.rule=Host("sftpgo.####")  
- traefik.http.routers.sftpgo-secure.tls=true  
- traefik.http.routers.sftpgo-secure.service=sftpgo-secure  
- traefik.http.services.sftpgo-secure.loadbalancer.server.port=8080  
- traefik.http.routers.sftpgo-secure.middlewares=middlewares-authentik@file  
- traefik.http.routers.webdav\_sftpgo.entrypoints=webexternal, web  
- traefik.http.routers.webdav\_sftpgo.rule=Host("webdav.####")  
- traefik.http.services.webdav\_sftpgo.loadbalancer.server.port=8080  
- traefik.http.routers.webdav\_sftpgo.service=webdav\_sftpgo  
- traefik.http.routers.webdav\_sftpgo-secure.entrypoints=websecureexternal, websecure  
- traefik.http.routers.webdav\_sftpgo-secure.rule=Host(`webdav.####`)  
- traefik.http.routers.webdav\_sftpgo-secure.tls=true  
- traefik.http.routers.webdav\_sftpgo-secure.service=webdav\_sftpgo-secure  
- traefik.http.services.webdav\_sftpgo-secure.loadbalancer.server.port=81

sftpgotwo:  
container\_name: sftpgotwo  
restart: always  
user: ####:####  
ports:  
- 2828:8080  
volumes:  
- type: bind  
source: ####  
target: /srv/sftpgo  
- type: bind  
source: ####  
target: /var/lib/sftpgo  
environment:  
- SFTPGO\_WEBDAVD\_\_BINDINGS\_\_0\_\_PORT=81  
image: 'drakkan/sftpgo:latest'  
networks:  
- traefik  
labels:  
- traefik.enable=true  
- traefik.docker.network=network\_traefik  
- traefik.http.routers.sftpgotwo.entrypoints=web  
- traefik.http.routers.sftpgotwo.service=sftpgotwo  
- traefik.http.services.sftpgotwo.loadbalancer.server.port=8080  
- traefik.http.routers.sftpgotwo.rule=Host("sftpgotwo.####")  
- traefik.http.routers.sftpgotwo-secure.entrypoints=websecure  
- traefik.http.routers.sftpgotwo-secure.rule=Host("sftpgotwo.####")  
- traefik.http.routers.sftpgotwo-secure.tls=true  
- traefik.http.routers.sftpgotwo-secure.service=sftpgotwo-secure  
- traefik.http.services.sftpgotwo-secure.loadbalancer.server.port=8080  
- traefik.http.routers.webdavtwo\_sftpgo.entrypoints=web  
- traefik.http.routers.webdavtwo\_sftpgo.rule=Host("webdavtwo.####")  
- traefik.http.services.webdavtwo\_sftpgo.loadbalancer.server.port=8080  
- traefik.http.routers.webdavtwo\_sftpgo.service=webdavtwo\_sftpgo  
- traefik.http.routers.webdavtwo\_sftpgo-secure.entrypoints=websecure  
- traefik.http.routers.webdavtwo\_sftpgo-secure.rule=Host("webdavtwo.####")  
- traefik.http.routers.webdavtwo\_sftpgo-secure.tls=true  
- traefik.http.routers.webdavtwo\_sftpgo-secure.service=webdavtwo\_sftpgo-secure  
- traefik.http.services.webdavtwo\_sftpgo-secure.loadbalancer.server.port=81

---

<div class="post-metadata">

**Author:** ![bobsdacool](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/bobsdacool/32/10140_2.png) [@bobsdacool](https://community.traefik.io/u/bobsdacool)\
**Post date:** [March 16, 2025, 8:01pm UTC](https://community.traefik.io/t/help-with-labels-for-duplicate-containers-in-the-same-stack/26887/2 "2025-03-16T20:01:03Z")

</div>

I found my solution by complete chance.

The issue arose from within sftpgo, the root directory contains two folders, data and sftpgohome. I had inadverntently put sftpgohome into my users directory within the data folder. Changing this fixed my issue.

I did not see any error logs in sftpgo to indicate there was a problem with the layout though, so will report to their github.

---

<div class="post-metadata">

**Author:** ![bobsdacool](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/bobsdacool/32/10140_2.png) [@bobsdacool](https://community.traefik.io/u/bobsdacool)\
**Post date:** [March 16, 2025, 8:25pm UTC](https://community.traefik.io/t/help-with-labels-for-duplicate-containers-in-the-same-stack/26887/3 "2025-03-16T20:25:01Z")

</div>

actually; scratch that, still no real joy. There must be some kind of local issue that I'm just not seeing, I'll keep at it.

---

<div class="post-metadata">

**Author:** ![bobsdacool](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/bobsdacool/32/10140_2.png) [@bobsdacool](https://community.traefik.io/u/bobsdacool)\
**Post date:** [March 16, 2025, 9:06pm UTC](https://community.traefik.io/t/help-with-labels-for-duplicate-containers-in-the-same-stack/26887/4 "2025-03-16T21:06:08Z")

</div>

Yeah, its strange, I've got the redirects working for the UI for both instances, but only one of the webdav instances is working... if anyone has any suggestions that'd be great.

---

<div class="post-metadata">

**Author:** ![bobsdacool](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/bobsdacool/32/10140_2.png) [@bobsdacool](https://community.traefik.io/u/bobsdacool)\
**Post date:** [March 16, 2025, 9:35pm UTC](https://community.traefik.io/t/help-with-labels-for-duplicate-containers-in-the-same-stack/26887/5 "2025-03-16T21:35:44Z")

</div>

Okay, further update, it seems theres an issue with the entrypoints; for whatever reason webdavtwo doesnt like the web and websecure entrypoints, but webdav is totally fine with them... I have no idea why this is, but going to keep digging.

---

<div class="post-metadata">

**Author:** ![bobsdacool](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/bobsdacool/32/10140_2.png) [@bobsdacool](https://community.traefik.io/u/bobsdacool)\
**Post date:** [March 16, 2025, 9:42pm UTC](https://community.traefik.io/t/help-with-labels-for-duplicate-containers-in-the-same-stack/26887/6 "2025-03-16T21:42:55Z")

</div>

Okay.

I think I've got it.

Turns out I had a local dns registry in my pihole instance for the webdav.

For whatever reason traefik doesnt like redirecting to the containers webdav on port 81 unless its redirected back to the ip, this is unlike my other services running that do not need this funcationality on the local network. Making a bug report now.

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [March 17, 2025, 5:51am UTC](https://community.traefik.io/t/help-with-labels-for-duplicate-containers-in-the-same-stack/26887/7 "2025-03-17T05:51:50Z")

</div>

Share your Traefik static and dynamic config.

Use 3 backticks before and after code/config, to make it more readable and preserve spacing, which is important in yaml.

---

<div class="post-metadata">

**Author:** ![bobsdacool](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/bobsdacool/32/10140_2.png) [@bobsdacool](https://community.traefik.io/u/bobsdacool)\
**Post date:** [March 17, 2025, 12:39pm UTC](https://community.traefik.io/t/help-with-labels-for-duplicate-containers-in-the-same-stack/26887/8 "2025-03-17T12:39:38Z")

</div>

Hi bluepuma.

Thanks for passing this on. It was a dns issue in the end, turns out I had a regex set up for redirects in my own dns, had forgotten about it, and it wasnt matching my second webdav.

I am still to learn even basic markdown; I'll make it my next self learning project!

Thanks for following up!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/b/bd81ebdb578656e76e56ff3cc3eed021d3ba132d.png) [@system](https://community.traefik.io/u/system)\
**Post date:** [March 20, 2025, 12:39pm UTC](https://community.traefik.io/t/help-with-labels-for-duplicate-containers-in-the-same-stack/26887/9 "2025-03-20T12:39:54Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
