# Traefik doesn't forward request to the service

**URL:** <https://community.traefik.io/t/traefik-doesnt-forward-request-to-the-service/3671>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [January 2, 2020, 12:19am UTC](https://community.traefik.io/t/traefik-doesnt-forward-request-to-the-service/3671 "2020-01-02T00:19:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jz22](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jz22](https://community.traefik.io/u/jz22)\
**Post date:** [January 2, 2020, 12:19am UTC](https://community.traefik.io/t/traefik-doesnt-forward-request-to-the-service/3671/1 "2020-01-02T00:19:41Z")

</div>

Hi,

I would like to use Traefik as load balancer for two backend containers, which are listening on port `2500`. The Traefik dashboard should be available at `traefik.localhost`. I also want the backend containers to automatically restart when they crashed.

When I run the `docker-compose` file below with `docker-compose --compatibility up --build`, I can access both backends directly on `backend.localhost:2500` and `backend.localhost:2501`. However, the backends should only be available through Traefik at `localhost:80`. Unfortunately, when I open `localhost:80`, it redirects to `http://localhost/dashboard/dashboard/dashboard/dashboard/...`.

This similar [question](https://community.containo.us/t/serving-traefiks-internal-dashboard-behind-traefik-itself/3457/7) didn't help.

Thanks for your help.

```auto
version: "3.4"

services:
  backend:
    deploy:
      replicas: 2
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.backend.rule=Host(`backend.local`)"
      - "traefik.http.routers.goserver.entrypoints=web"
      - "traefik.http.services.backend.loadbalancer.server.port=2500"
    ports:
      - "2500-2501:2500"
    build: .
    restart: always
    healthcheck:
      test: curl http://127.0.0.1:2500 -s -f -o /dev/null || exit 1
      interval: 10s
      timeout: 10s
      retries: 3
  traefik:
    image: traefik:v2.1.1
    container_name: traefik
    command:
      - --log.level=INFO
      - --entrypoints.web.address=:80
      - --api
      - --providers.docker.exposedbydefault=false
      - '--providers.docker.defaultRule=Host(`{{ index .Labels "com.docker.compose.service" }}.localhost`)'
    ports:
      - "80:80"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
    labels:
      traefik.enable: true
      traefik.http.routers.traefik.service: api@internal
      traefik.http.routers.traefik.entrypoints: web

```

---

<div class="post-metadata">

**Author:** ![zespri](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/zespri/32/310_2.png) [@zespri](https://community.traefik.io/u/zespri)\
**Post date:** [January 3, 2020, 2:52am UTC](https://community.traefik.io/t/traefik-doesnt-forward-request-to-the-service/3671/2 "2020-01-03T02:52:49Z")

</div>

There is a lot of things here that is wrong with that config, I'm not sure I spotted them all:

- traefik declaration does not have a deploy tag for swarm
- traefik [swarm mode](https://docs.traefik.io/providers/docker/#docker-swarm-mode) of docker provider is not enabled
- Labels are not [in the deploy part of the service](https://docs.traefik.io/providers/docker/#routing-configuration-with-labels_1)
- You are trying to open `localhost` and you do not have a rule that would match `localhost`
