# Switching from labels to dynamic conf - not working

**URL:** <https://community.traefik.io/t/switching-from-labels-to-dynamic-conf-not-working/21420>\
**Category:** Traefik v2\
**Tags:** file, docker\
**Created:** [February 8, 2024, 5:17pm UTC](https://community.traefik.io/t/switching-from-labels-to-dynamic-conf-not-working/21420 "2024-02-08T17:17:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rationellt](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@rationellt](https://community.traefik.io/u/rationellt)\
**Post date:** [February 8, 2024, 5:17pm UTC](https://community.traefik.io/t/switching-from-labels-to-dynamic-conf-not-working/21420/1 "2024-02-08T17:17:22Z")

</div>

When I deploy my Docker container, which I'm having issues with, using labels, everything works as it should. But when I now wish to switch it from using labels to dynamic configuration, it doesn't work. I get a 404 error. I have other Docker containers running, and I can point to them from the dynamic configuration without any problems.

My Docker Compose file with labels looks like this:

```auto
services:
  ocis:
    image: owncloud/ocis:latest
    container_name: ocis
    restart: unless-stopped
    volumes:
      - ocis-config:/etc/ocis
      - ocis-data:/var/lib/ocis

```

...

```auto
    networks:
      - traefik-proxy
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.ocis.rule=Host(`files.secret-filestorage.io`)"
      - "traefik.http.routers.ocis.entrypoints=websecure"
      - "traefik.http.routers.ocis.tls=true"
      - "traefik.http.services.ocis.loadbalancer.server.port=9200"
      - "traefik.http.routers.ocis.service=ocis"

```

My Docker Compose file without configuration labels looks like this:

```auto
    networks:
      - traefik-proxy
    labels:
      - "traefik.enable=true"

```

My dynamic configuration, when I run without labels, looks like this:

```auto
http:
  routers:
    ocis:
      entryPoints: websecure
      rule: Host (`files.secret-filestorage.io`)
      service: ocis-service
      tls: {}

  services:
     ocis-service:
       loadBalancer:
         servers:
           - url: http://ocis

```

I deliberately omitted irrelevant configuration since nothing else has changed except for moving the configuration.

Looking at the Traefik Dashboard for the service created, the dynamically created service points to the correct IP address and port for the Docker container.

What am I missing, I wonder?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![youngt2](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/youngt2/32/6055_2.png) [@youngt2](https://community.traefik.io/u/youngt2)\
**Post date:** [February 8, 2024, 6:31pm UTC](https://community.traefik.io/t/switching-from-labels-to-dynamic-conf-not-working/21420/2 "2024-02-08T18:31:07Z")

</div>

I think entrypoints needs to be an array.

> **[Traefik Routers Documentation - Traefik](https://doc.traefik.io/traefik/routing/routers/#entrypoints)**
>
> In Traefik Proxy, a router is in charge of connecting incoming requests to the Services that can handle them. Read the technical documentation.

```auto
http:
  routers:
    ocis:
      entryPoints:
        - websecure
      rule: Host (`files.secret-filestorage.io`)
      service: ocis-service
      tls: {}

```

---

<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:** [February 8, 2024, 6:35pm UTC](https://community.traefik.io/t/switching-from-labels-to-dynamic-conf-not-working/21420/3 "2024-02-08T18:35:42Z")

</div>

In labels you specify the ocis port to be used internally, in file you don’t, Traefik will use default port 80.

Enable and check Traefik log for errors.

---

<div class="post-metadata">

**Author:** ![rationellt](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@rationellt](https://community.traefik.io/u/rationellt)\
**Post date:** [February 8, 2024, 8:58pm UTC](https://community.traefik.io/t/switching-from-labels-to-dynamic-conf-not-working/21420/4 "2024-02-08T20:58:39Z")

</div>

Aha! I actually didn't know that, and I couldn't guess it either because the service in the Traefik Dashboard showed both the desired IP address and the required port. I checked the log file, as you said, and then I could see that the request was made from port 80. Shame on me for not checking there first.

I added the port to the URL now, and it works as intended. Thank you so much!

---

<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:** [February 11, 2024, 8:59pm UTC](https://community.traefik.io/t/switching-from-labels-to-dynamic-conf-not-working/21420/5 "2024-02-11T20:59:27Z")

</div>

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