No http connection to webserver / Error 404

Hi all,

i try to set up traefik as a reverse proxy to access some of my servers at home (no docker, only "normale" servers). But i got two problems, where i have no idea to fix this.

  1. I try to access from the internet the adress http://foo.bar.eu/some. But everytime i try it, i got the message "404 page not found". If i try to access this site directly after the start of traefik, i get an warning that the ssl certificate is not valid.
    So i got no idea where i can further look to find the problem. For me it looks like that traefik work till to some point and stuck there.

  2. From the previouse problem i guess that i get also no certificate for my site. (also acme.json has a sice of 0 byte). I thought that traefik manage this? Or did i miss here something?

Would be nice if somebody could help me with my problems.....

Regards
gerribaldi

traefik.toml

[global]
  checkNewVersion = true
  sendAnonymousUsage = false

# Entrypoints definition
#
# Default:
[entryPoints]
  [entryPoints.web]
    address = ":80"

  [entryPoints.websecure]
    address = ":443"

[certificatesResolvers.sample.acme]
  email = "herrscher@moekki.eu"
  storage = "acme.json"
  [certificatesResolvers.sample.acme.httpChallenge]
    # used during the challenge
    entryPoint = "web"

# Traefik logs
# Enabled by default and log to stdout
[log]

  # Log level
  # Default: "ERROR"
  level = "DEBUG"

  # Sets the filepath for the traefik log. If not specified, stdout will be used.
  # Intermediate directories are created if necessary.
  # Default: os.Stdout
  filePath = "log/traefik.log"

  # Format is either "json" or "common".
  # Default: "common"
  format = "common"

# Optional
#
# [accessLog]

  # Sets the file path for the access log. If not specified, stdout will be used.
  # Intermediate directories are created if necessary.
  # Default: os.Stdout
  #
  # filePath = "/path/to/log/log.txt"
  #filePath = "log/access.log"

  # Format is either "json" or "common".
  # Default: "common"
  #format = "common"


# Enable API and dashboard
[api]

  # Name of the related entry point
  # Default: "traefik"
  # entryPoint = "traefik"

  # Enabled Dashboard
  # Default: true
  #
  dashboard = true
  insecure = true

# Enable ping
[ping]

  # Name of the related entry point
  # Default: "traefik"
  #
  entryPoint = "traefik"

# Enable Docker configuration backend
[providers.docker]

  # Docker server endpoint. Can be a tcp or a unix socket endpoint.
  #
  # Required
  # Default: "unix:///var/run/docker.sock"
  #
  # endpoint = "tcp://10.10.10.10:2375"

  # Default host rule.
  #
  # Optional
  # Default: "Host(`{{ normalize .Name }}`)"
  #
  # defaultRule = "Host(`{{ normalize .Name }}.docker.localhost`)"

  # Expose containers by default in traefik
  #
  # Optional
  # Default: true
  #
  # exposedByDefault = false

[providers]
  [providers.file]
    #filename = "dynamic_conf.toml"
    directory = "/etc/traefik"
    watch = true




dynamic_conf.toml

# http routing section
[http]
  [http.routers]
     # Define a connection between requests and services
     [http.routers.to-foo]
      rule = "Host(`foo.bar.eu`) && PathPrefix(`/some`)"
      service = "foo"

  [http.middlewares]
    #[http.middlewares.add-webmail.addPrefix]
    #  prefix = "/some"

  [http.services]
    # Define how to reach an existing service on our infrastructure
    [http.services.foo]
      [[http.services.foo.loadBalancer.servers]]
        url = "http://foo.bar.eu/"

Hello,

you need to set the resolver on the router: https://docs.traefik.io/v2.0/routing/routers/#certresolver

Also maybe you need to take a look to Global http to https redirect in v2

I guss it´s a stupid questions, but what should i set for certResovler?

Redirect to https i will try later, first i want http get to run. But this is also not working....

After checking the logs again i found that the file handler didn't load the config dir. so i changed it from /etc/traefik to /etc/traefik/dynamic