Can't Access Dashboard on HTTPS

I am getting 404 errors whenever I try to access the dashboard on an HTTPS connection instead of HTTP. I created the following example GitHub repository to demonstrate the code/configuration that has the issue.

I made sure to input a router rule, and implement authentication through a middleware implementing HTTP basic auth.

I also made sure to set the API insecure to false, instead of true.

I notice that most other people go down the line of using a lot of labels, but I find it much cleaner to use a static and dynamic YAML config file. Hopefully this is not an issue. Also, one other main difference is that I'm using local wildcard certificate files instead of Lets Encrypt (the certificate files were issued by Lets Encrypt though).

What am I missing? Do I need another piece of middleware to perform some sort of redirect?

Hello @Programster and thanks for your interest Traefik,

The configuration issue is in the dashboard router configuration. As explained in the following documentation, to enable TLS on a router the tls option must be set, like in the following config:

http:
  routers:
    whoami:
      rule: Host(`whoami.localhost`)
      service: whoami
      tls: {} # <-- Enable TLS

Please note that the router will not be available anymore through HTTP. Therefore, it is possible to configure the HTTP -> HTTPS redirection at the EntryPoint level or with a middleware.

Hope this helps!

1 Like

Brilliant thanks. I'll test that later and mark that as the solution once confirmed. I'm sure that is probably obvious to most, I'm just not too familiar with Traefik yet. Thanks for your help :slight_smile:

1 Like

Awesome, can you mark the topic as solved?

Sorry for the delay, have tested and marked as solution.

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