Traefik v2 error 404

Hello, I come here because it's been a while since I've been able to solve my problems so last hope! and thanks to those who will help me

I can't find my url, I get a 404 page not found each time unfortunately

here is the configuration of my files (git-rule.toml, traefik.toml, docker-compose.yml) :


  # Dedicated router for Yeswecan SCM.
    entryPoints = ["web"]
    middlewares = ["https_redirect"]
    rule = "Host(``)"
    service = "project"
    # Using main certResolver conf. to request a certificate; declared in traefik.toml.
      certResolver = "dedicated"

  # Dedicated service for Yeswecan SCM (GitLab).
      url = ""


# Main entryPoints definition block.
     address = ":80"
     address = ":443"

# SSL/TLS certificate configuration block; provided by Let's encrypt.
  email = ""
  storage = "/etc/traefik/acme/acme.json"
  caServer = ""
  # Cert. validation made through http challenge and "web" entryPoint.
   entryPoint = "web"

    directory = "/etc/traefik/"
    watch = true

  filePath = "/var/log/traefik/traefik.log"
  format = "common"

# Traefik API is enabled.
  dashboard = true # Dashboard is available only "locally" (Yeswecan internal network)
  insecure = true # No authentication on dashboard

# Main middlewares configuration block.
  # Traffic redirection from every router calling this middleware (http ---> https).
    scheme = "https"
    permanent = true


version: '3.3'

    image: traefik:v2.1.3
    container_name: "traefik"
      - "--api.insecure=true"
      - "--certificatesresolvers.dedicated.acme.httpchallenge=true"
      - "--certificatesresolvers.dedicated.acme.httpchallenge.entrypoint=web"
      - ""
      - ""
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "--entrypoints.api.address=:8080"
      - "--log.level=DEBUG"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"

      - "80:80"     # The HTTP port
      - "8080:8080" # The Web UI (enabled by --api)
      - "443:443"   # The HTTPS port
      - /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
      - ./traefik.toml:/etc/traefik/traefik.toml
      - ./rules:/etc/traefik/rules
      - ./acme/acme.json:/etc/traefik/acme/acme.json
      - ./log:/var/log/traefik

Hello @PKXL

I deployed your configuration on my local environment and I found that entry point WEB has not been started:

time="2021-03-05T12:17:14Z" level=error msg="entryPoint \"web\" doesn't exist" routerName=project@file entryPointName=web
time="2021-03-05T12:17:14Z" level=error msg="no valid entryPoint for this router" routerName=project@file

It happened because of the overwritten configuration. Traefik loads the configuration in the following order:

  • File
  • Flags (CLI command)
  • Environment variables

Here is the code which is responsible for that: traefik/traefik.go at master · traefik/traefik · GitHub

See also our official docs: Configuration Introduction - Traefik | Site | v2.4

A few good practices:

  1. As it is written in the documentation use only one source for static configuration. Don't mix CLI commands with config file or environment variables. Thus, I suggest moving entrypoints from the command section to traefik.toml file.

  2. I also suggest grouping config section e.g. log level Debug has been configured through command and then in TOML file. Let's try to keep that in one config provider .e.g in TOML file.

  3. Regarding routers I suggest creating two routers: one for HTTP and the second routers for HTTPS. On the HTTP router you can create a redirection from HTTP to HTTPS and on the HTTPS router you can add TLS configuration

  4. Enableing api.insecure=true automatically starts internal entrypoint called Traefik on 8080/TCP inside a container, so no need to enable a dedicated API entry point. Actually, it won't start and will throw an error that can't bind to the 8080 port.

  5. I highly recommend upgrading Traefik to the latest version, for today it is 2.4.6

Hope that helps. Please let us know the results of your deployment.

1 Like

Thanks a lot mister !

it was due to a confusion of redirection to websecure in my traefik.toml file !

1 Like

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