Traefik returns the dashboard when using curl, but '404 not found' when call from browser

Hi, I'm having a particular problem about configuring traefik, where calling to "http://mydomain.com:8080/dashboard from browser returns a '404 not found'. Yet when I send a request through powershell command Invoke-WebRequest - Uri "http://mydomain.com:8080/" it returns a 200 code with the following content:


Which, I assume it is working fine

Here's my docker-compose.yml file:

  reverse-proxy:
    image: traefik:latest
    command:
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "--entrypoints.web.http.redirections.entrypoint.to=websecure"
      - "--entrypoints.web.http.redirections.entrypoint.scheme=https"
      - "--entrypoints.web.http.redirections.entrypoint.permanent=true" # redirect http to https
      - "--certificatesresolvers.myresolver.acme.tlschallenge=true"
      - "--certificatesresolvers.myresolver.acme.email=${EMAIL}"
      - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    networks:
      - gignet
    volumes:
      - ./letsencrypt:/letsencrypt
      - /var/run/docker.sock:/var/run/docker.sock
  api:
    image: rutkre/gigbuds:v1.0.8
    restart: unless-stopped
    environment:
      - ASPNETCORE_ENVIRONMENT=Production
      - ASPNETCORE_URLS=http://+:8001
    expose:
      - "8001"
    depends_on:
      db:
        condition: service_healthy
      cache:
        condition: service_healthy
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.api.rule=Host(`${DOMAIN_NAME}`)"
      - "traefik.http.routers.api.entrypoints=websecure"
      - "traefik.http.routers.api.tls=true"
      - "traefik.http.routers.api.tls.certresolver=myresolver"
      - "traefik.http.services.api.loadbalancer.server.port=8001"
      - "traefik.http.routers.api.priority=50"
    volumes:
      - /home/deploy/gigbuds/credentials/firebase-service-storage.json:/app/firebase-service-storage.json
      - /home/deploy/gigbuds/credentials/firebase-service-notification.json:/app/firebase-service-notification.json
      - /home/deploy/gigbuds/appsettings.json:/app/appsettings.json
    networks:
      - gignet

Any help is appreciate!

Enable and check Traefik debug log (doc), are routers created? Enable and check Traefik access log in JSON format (doc), what’s the output during requests?

Thanks for the reply, I've checked the logs, but it shows no clue about the port 8080 configs, apart from the 'Static configuration loaded ...' line. Though I did see the dashboard service, if I'm not mistaken. Pardon me the timestamps, I should've turned of portainer's timestamp logging
2025-07-25T22:56:30.931196079Z 2025-07-25T22:56:30Z DBG github.com/traefik/traefik/v3/pkg/middlewares/stripprefix/strip_prefix.go:32 > Creating middleware entryPointName=traefik middlewareName=dashboard_stripprefix@internal middlewareType=StripPrefix routerName=dashboard@internal

Here are the logs 2025-07-25T22:56:30.620186243Z 2025-07-25T22:56:30Z INF github.com/traefik/traef - Pastebin.com

Other services works as expected, its just the dashboard

I got it, after I added the labels, traefik can finally route to the dashboard.

  labels:
      - "traefik.enable=true"
      - "traefik.http.routers.dashboard.rule=Host(`dashboard.${DOMAIN_NAME}`)"
      - "traefik.http.routers.dashboard.entrypoints=websecure"
      - "traefik.http.routers.dashboard.tls=true"
      - "traefik.http.routers.dashboard.tls.certresolver=myresolver"
      - "traefik.http.routers.dashboard.service=api@internal"
      - "traefik.http.middlewares.dashboard-auth.basicauth.users=${DASHBOARD_AUTH_USERS}"
      - "traefik.http.routers.dashboard.middlewares=dashboard-auth@docker"```

In addition to that, I also had to change the 'api' service name to 'api-server'. I think Traefik might confuses which api service to use, its own internal 'api' or my 'api'

Note that this will create an insecure entrypoint on 8080 without auth - you should remove it.

Check simple Traefik example for best practice

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