An issue with route to different services running on the same node


So, I'm having an issue. I have two services running on the same VPN with wildcard SSL certificate.
When I connect to the consul first then all later connections to the traefik are redirected to the consul. However, if I first connect to traefik then all connection to the consul are return with "404 page not found". In short, it's not possible to have both pages open at the same time. Beside this, all works as it should, no issue with redirection from http to https, certificate or authentication. Separately, each service works at it's best but not together.

Here is my complete all_dynamic.yml configuration file.

      entrypoints = ["web"]
      rule = "HostRegexp(`{host:.+}`)"
      middlewares = ["redirect_to_https"]
      service = "noop"

      entrypoints = ["web-secure"]
      rule = "Host(``)"
      middlewares = ["auth"]
      service = "api@internal"

      scheme = "https"
      permanent = true

      users = ["traefik:$apr1$R74sSIc.$5QQnTtXYaX60NKNrXFUYl."]

        url = ""

      entrypoints = ["web-secure"]
      rule = "HostSNI(``)"
      service = "consul"
        passthrough = true
        address = ""
        address = ""
        address = ""

    certFile = "/data01/cert/"
    keyFile = "/data01/cert/"


Can you give a bit more info please? In particular, how do you test: what exactly do you do and what you are observing. Also please provide a bit more details on cosul setup, what is the use of port 8000 and how tls is setup for it in consul.

Port 8000 is used by consul to provide secure connection to K/V store. This part works as expected with no issue at all. The problem is with kind of exclusion when I try to open this two pages at the same time: and Perhaps will be easier to show some pictures for better understanding.
Step 1. Open traefik page:

Step 2. Open consul page:

But when I start in oposit direction, the consul page is open first, then things looks different:


Step 1. Open consul page:
Step 2. Open traefik page:
Take a look at address here and page content.

Thanks for the pic they help. At the risk of repeating myself, how did you setup TLS on consul? I would apreciate if you could answer this, even if you feel it's irrelevant.

Sure, no problem, here is complete consul configuration:

server = true
ui = true
bootstrap_expect = 3
node_name = "is-srecore01t"
retry_join = ["","",""]
datacenter = "dc1-test"
primary_datacenter = "dc1-test"
acl = {
  enabled = true
  default_policy = "deny"
  enable_token_persistence = true
  tokens = {
    default = "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx"
cert_file = "/data01/cert/"
key_file = "/data01/cert/"
ca_file = "/data01/cert/meCA2.pem"
verify_server_hostname = true
protocol = 3
data_dir = "/data01/consul/data"
client_addr = ""
bind_addr = ""
addresses = {
  https = ""
ports = {
  https = 8000
log_level = "info"
rejoin_after_leave = true
leave_on_terminate = true
disable_remote_exec = true
disable_update_check = true

Try clearing browser cache / restarting browser / using incognito mode. Make sure that if you are using toml configuration with traefik you do not have the file named all_dynamic.yml (note extension).

I tried your configuations, and it works, so I cannot reproduce your result. Which means the problem somewhere in what you are not showing.

The changes I made to your config:

Commented out middleware auth, both definiton and reference, changed the ip address, commented out 2 out of three load balacnced tcp servers.

Can see consul at and traefik at