how solve "Router defined multiple times with different configurations configuration"

version: "3"

services:
  traefik:
    image: traefik:v3.0.0-beta3
    restart: always
    ports:
      - 80:80
      - 8080:8080
    command:
      - "--api=true"
      - "--api.dashboard=true"
      - "--api.insecure=true"
      - "--ping=true"
      - "--entrypoints.http.address=:80"
      - "--providers.docker=true"
      - "--providers.docker.endpoint=unix:///var/run/docker.sock"
    labels:
      - "traefik.http.routers.traefik-dashboard.entrypoints=http"
      # - "traefik.http.routers.traefik-dashboard.rule=Host(`traefik.console.lab.io`)"
      - "traefik.http.routers.traefik-dashboard.service=dashboard@internal"
      - "traefik.http.routers.traefik-dashboard-api.entrypoints=http"
      # - "traefik.http.routers.traefik-dashboard-api.rule=Host(`traefik.console.lab.io`) && PathPrefix(`/api`)"
      - "traefik.http.routers.traefik-dashboard-api.rule=PathPrefix(`/api`)"
      - "traefik.http.routers.traefik-dashboard-api.service=api@internal"
      # 中间件
      - "traefik.http.middlewares.gzip.compress=true"
      - "traefik.http.routers.traefik-dashboard.middlewares=gzip@docker"
      - "traefik.http.routers.traefik-dashboard-api.middlewares=gzip@docker"
      # 具体服务
      - "traefik.http.routers.backend-x-service.rule=Host(`backend-x-service`) && PathPrefix(`/x/`)"
      # - "traefik.http.routers.backend-auth-service.rule=PathPrefix(`/auth/`)"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    healthcheck:
      test: ["CMD-SHELL", "wget -q --spider --proxy off localhost:8080/ping || exit 1"]
      interval: 3s
      retries: 10
    logging:
      driver: "json-file"
      options:
        max-size: "1m"
    networks:
      - platform-common-net
networks:
  platform-common-net:
    # 声明这个网络是外部定义的
    external: true

find error:

traefik_1 | 2023-10-08T07:54:29Z ERR Router defined multiple times with different configurations configuration=["backend-x-service-9ff856a804f651e8f47576caa94fe27dbfeef97d70fd2099299c95a1583e0c66","traefik-traefik-docker-ad370e7240821fde9e6cb9061d59940ea54a60870933d30e87c9d31763ab1a40"] providerName=docker routerName=backend-x-service

Your config looks complicated. Why have api and dashboard separate?

What is backend-x-service supposed to do? You need to place the label on the target Docker service.

Ah, you missed to post your other docker-compose.yml here, which also uses traefik.http.routers.backend-x.rule.

See simple Traefik example.