# Traefik dashboard behind load balancer with path getting 404

**URL:** https://community.traefik.io/t/traefik-dashboard-behind-load-balancer-with-path-getting-404/25893
**Category:** Traefik v3 (latest)
**Tags:** docker-swarm
**Created:** [January 8, 2025, 9:46am UTC](https://community.traefik.io/t/traefik-dashboard-behind-load-balancer-with-path-getting-404/25893 "2025-01-08T09:46:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![bakternixvan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/bakternixvan/32/9791_2.png) [@bakternixvan](https://community.traefik.io/u/bakternixvan)
#### Post date: [January 8, 2025, 9:46am UTC](https://community.traefik.io/t/traefik-dashboard-behind-load-balancer-with-path-getting-404/25893/1 "2025-01-08T09:46:20Z")

</div>

On my hosting provider I've setup a load balancer that will handle the SSL certificate. I've setup a domain name, `api.example.nl` that points to that load balancer.

The load balancer is connected to a server running docker swarm and I've setup a traefik container:

```yaml
services:
  traefik:
    image: traefik:v3.3.0
    hostname: '{{.Node.Hostname}}'
    deploy:
      placement:
        constraints:
          - node.role == manager
      mode: global
      labels:
        - traefik.enable=true
        - traefik.http.routers.dashboard.rule=Host(`api.example.nl`) && Path(`/traefik`)
        - traefik.http.routers.dashboard.service=api@internal
        - traefik.http.routers.dashboard.middlewares=auth
        - traefik.http.middlewares.auth.basicauth.users=example:$$apr1$$LYLCV6G2$$z9BY.rQzoXsXe/18dEBoq/
        - traefik.http.services.dashboard.loadbalancer.server.port=9999
    volumes:
        - /var/run/docker.sock:/var/run/docker.sock:ro
    ports:
      - target: 80
        published: 80
        protocol: tcp
        mode: host
    networks:
      - traefik_proxy
    command:
      - --log.level=DEBUG
      - --api.dashboard=true
      - --accesslog=true
      - --providers.swarm.network=traefik_proxy
      - --providers.swarm.exposedByDefault=false
      - --entrypoints.http.address=:80

networks:
  traefik_proxy:
    external: true

```

When I go to `https://api.example.nl/traefik` it does asks for credentials. When I login, I get a `404 page not found` message displayed.

However, when I change

```auto
- traefik.http.routers.dashboard.rule=Host(`api.example.nl`) && Path(`/traefik`)

```

to

```auto
- traefik.http.routers.dashboard.rule=Host(`traefik.example.nl`)`

```

I get the dashboard at `traefik.example.nl`.

Both subdomains do point to the same IP address of the load balancer and the load balancer has successfully added the SSL certificates from LetsEncrypt.

So why do I get a `404` error with `api.example.nl` and path `/traefik` and how do I fix it?

---

<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: [January 8, 2025, 10:31am UTC](https://community.traefik.io/t/traefik-dashboard-behind-load-balancer-with-path-getting-404/25893/2 "2025-01-08T10:31:23Z")

</div>

Because the Traefik dashboard application is programmed to have the dashboard available at `/dashboard`, and it needs `/api` ([doc](https://doc.traefik.io/traefik/operations/dashboard/#dashboard-router-rule)). If you use other paths, which are unknown to the application, it will simply return 404.

* * *

```auto
    volumes:
        - /var/run/docker.sock:/var/run/docker.sock:ro

```

Note that this has no "ro" effect, as it's a socket connection. The application with access to the socket can always GET, POST and DELETE anything. It can read secrets, create new containers and delete others.
