[SOLVED] Configuration issue with external service

I have a working installation of Traefik (latest) running on docker.
It can find my docker containers and those with the proper labels can be viewed by a domainname.
So far so good.

Now I want to add an external service to the proxy.

My traefik.toml config looks like this:

################################################################
#
# Configuration sample for Traefik v2.
#
# For Traefik v1: https://github.com/traefik/traefik/blob/v1.7/traefik.sample.toml
#
################################################################

################################################################
# Global configuration
################################################################
[global]
  checkNewVersion = true
  sendAnonymousUsage = true

################################################################
# Entrypoints configuration
################################################################

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


  [entryPoints.web.http]
    [entryPoints.web.http.redirections]
      [entryPoints.web.http.redirections.entryPoint]
        to = "websecure"
        scheme = "https"

  [entryPoints.websecure]
    address = ":443"
    [entryPoints.websecure.http.tls]

[providers]
  [providers.file]
    directory = "/certificates/"

################################################################
# Traefik logs configuration
################################################################

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

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

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

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

################################################################
# Access logs configuration
################################################################

# Enable access logs
# By default it will write to stdout and produce logs in the textual
# Common Log Format (CLF), extended with additional fields.
#
# Optional
#
# [accessLog]

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

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

################################################################
# API and dashboard configuration
################################################################

# Enable API and dashboard
[api]
  insecure = true

  # Enable the API in insecure mode
  #
  # Optional
  # Default: false
  #
  # insecure = true

  # Enabled Dashboard
  #
  # Optional
  # Default: true
  #
  # dashboard = false

################################################################
# Ping configuration
################################################################

# Enable ping
[ping]

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

################################################################
# Docker configuration backend
################################################################

# Enable Docker configuration backend
[providers.docker]
  endpoint = "unix:///var/run/docker.sock"
  defaultRule = "Host(`{{ normalize .Name }}.mydomain.com`)"

  # 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

And my config.yml (which is the certificates folder) looks like this:

http:
  routers:
    myhomeassistant:
      entryPoints:
        - "websecure"
      rule: "Host(`ha.mydomain.com`)"
      middlewares:
        - default-headers
      tls: {}
      service: myhomeassistant
      
  services:
    myhomeassistant:
      loadBalancer:
        servers:
          - url: "http://192.168.X.X:8123"
        passHostHeader: false

  middlewares:

    https-redirect:
      redirectScheme:
        scheme: https

    default-headers:
      headers:
        frameDeny: true
        sslRedirect: true
        browserXssFilter: true
        contentTypeNosniff: true
        forceSTSHeader: true
        stsIncludeSubdomains: true
        stsPreload: true

    default-whitelist:
      ipWhiteList:
        sourceRange:
        - "10.0.0.0/24"
        - "192.168.0.0/24"
        - "172.0.0.0/8"

    secured:
      chain:
        middlewares:
        - default-whitelist
        - default-headers

When I go the page https://ha.mydomain.com I get a "404 page not found" error.
This is from the error log

time="2021-05-02T17:02:44Z" level=error msg="entryPoint "https" doesn't exist" routerName=myhomeassistant@file entryPointName=https

time="2021-05-02T17:02:44Z" level=error msg="no valid entryPoint for this router" routerName=myhomeassistant@file

UPDATE WITH SOLUTION. EXAMPLE NOW SHOWS WORKING CONFIGS!

Look back at your traefik.toml file, you configured the entrypoint for port 443 as "websecure", but then in your config, you are trying to use a non-existent entrypoint named https.. try changing that config.yml entry from:

entryPoints:
  - "https"

TO:

entryPoints:
  - "websecure"

That worked.

Code updated so the next guy only see a working example

1 Like

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