1

Issue: I have set up Metabase behind Traefik, running as a Docker container. But it's getting 404 error. I want to access through - dashboard.{{hostname}}. What can be the issue & how can I solve it?

my configurations:

docker-compose.deploy.yml

  metabase:
    labels:
      - 'traefik.enable=true'
      - 'traefik.frontend.rule=Host: dashboard.{{hostname}}'
      - 'traefik.port=3001'
      - 'traefik.docker.network=lamt_overlay_net'
    networks:
      - overlay_net

docker-compose.deps.yml

  metabase:
      image: metabase/metabase
      restart: unless-stopped
      depends_on:
        - mongo
      ports:
        - '3001:3000'
      volumes:
        - ./infrastructure/metabase:/metabase-data
      environment:
        - MB_DB_FILE=/metabase-data/metabase.db
        # - MB_H2_DB_JDBC_URL=jdbc:h2:file:/metabase-data/metabase.db/metabase.db
      deploy:
        replicas: 1

traefik inside docker-compose.deploy.yml:

traefik:
    image: traefik:1.7.30
    ports:
      - '80:80'
      - '443:443'
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /data/traefik/acme.json:/acme.json
      - /var/log/traefik.log:/var/log/traefik.log
    configs:
      - source: traefik.{{ts}}
        target: /etc/traefik/traefik.toml
    deploy:
      replicas: 1
      placement:
        constraints:
          - node.role == manager
    networks:
      - overlay_net

traefik.toml:

logLevel = "DEBUG"
defaultEntryPoints = ["http", "https"]
insecureSkipVerify = true

[traefikLog]
  filePath = "/var/log/traefik.log"
  format   = "json"

[accessLog]
  filePath = "/var/log/access.log"
  format   = "json"

[entryPoints]
  [entryPoints.http]
  address = ":80"
    [entryPoints.http.redirect]
    entryPoint = "https"
  [entryPoints.https]
  address = ":443"
  [entryPoints.https.tls]

[api]

[ping]

[docker]
domain = "{{hostname}}"
swarmMode = true
exposedByDefault = false
watch = true

[acme]
email = "abc@xyz.com"
storage = "acme.json"
entryPoint = "https"
onHostRule = true

[acme.httpChallenge]
entryPoint = "http"

[[acme.domains]]
  main = "{{hostname}}"
  sans = ["client.{{hostname}}", "gateway.{{hostname}}", "auth.{{hostname}}", "login.{{hostname}}", "api.{{hostname}}", "dashboard.{{hostname}}"]

[retry]

# Enable gzip compression
[http.middlewares]
  [http.middlewares.test-compress.compress]
Robin
  • 75
  • 1
  • 5
  • The docker-compose.deploy.yml needs the deploy command before labels and the backend rule is required to resolve the 404. But you are still getting a 502. Not sure why – Euan Millar Dec 13 '21 at 22:57

0 Answers0