title: Route Traefik UI with Traefik
body: <p>I'm new to Docker and Traefik, so I decided to play with them a little. I tried to follow this Digital Ocean tutorial : <a href="https://www.digitalocean.com/community/tutorials/how-to-use-traefik-as-a-reverse-proxy-for-docker-containers-on-ubuntu-16-04" rel="nofollow noreferrer">https://www.digitalocean.com/community/tutorials/how-to-use-traefik-as-a-reverse-proxy-for-docker-containers-on-ubuntu-16-04</a> </p>
  
  <p>I'm trying to run a simple traefik docker container, and access the web UI on port 8080 through traefik redirection, I.E, I want to access traefik UI at <a href="https://myhost/traefik" rel="nofollow noreferrer">https://myhost/traefik</a> </p>
  
  <p>I don't have domain name so I don't want to use Host rules to redirect with Traefik. Instead I wanted to use the PathPrefixStrip rule. </p>
  
  <p>Here is my file <code>run_traefik.sh</code> :</p>
  
  <pre><code>#!/bin/bash
  
  docker run \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v $PWD/traefik.toml:/traefik.toml \
    -v $PWD/acme.json:/acme.json \
    -p 80:80 \
    -p 443:443 \
    -l traefik.port=8080 \
    -l traefik.backend=traefik_dashboard \
    -l "traefik.frontend.rule=PathPrefixStrip:/traefik/" \
    --network proxy_network \
    --name traefik \
    traefik:1.3.6-alpine --web --docker --docker.domain=docker.localhost --logLevel=DEBUG
  </code></pre>
  
  <p>And here is my <code>traefik.toml</code> file : </p>
  
  <pre><code>defaultEntryPoints = ["http", "https"]
  
  [web]
  adress = ":8080"
      [web.auth.basic]
      users = ["admin:$apr1$lVhuCVSI$JrCUdpV0PmduJ1b7FzhrX1"]
  
  
  [entryPoints]
    [entryPoints.http]
    adress = ":80"
  
    [entryPoints.https]
    adress = ":443"
      [entryPoints.https.tls]
  
  [acme]
  email = "myemail@provider.com"
  storage = "acme.json"
  entryPoint = "https"
  onHostRule = true
  onDemand = false
  
  [acme.httpChallenge]
  entryPoint = "http"
  
  [docker]
  domain = "docker"
  endpoint = "unix:///var/run/docker.sock"
  watch = true
  </code></pre>
  
  <p>And Ijust <code>touch acme.json</code> and <code>chmod 600 acme.json</code> in order for LE to work. </p>
  
  <p>Here is my problem :</p>
  
  <p>When I try to access <a href="https://myhost/traefik" rel="nofollow noreferrer">https://myhost/traefik</a> I'm redirected to <a href="https://myhost/dashboard/" rel="nofollow noreferrer">https://myhost/dashboard/</a> so I get a 404 NOT FOUND error.</p>
  
  <p>Curiously when I try to access <a href="https://myhost/traefik/dashboard/#/" rel="nofollow noreferrer">https://myhost/traefik/dashboard/#/</a> it redirects me to <a href="https://myhost/dashboard/#/" rel="nofollow noreferrer">https://myhost/dashboard/#/</a> so it works well </p>
  
  <p>But I don't want to specify full path ! And when I expose port 8080 in the docker run and I try to access <a href="http://myhost:8080" rel="nofollow noreferrer">http://myhost:8080</a> I'm redirected without problem to <a href="http://myhost:8080/dashboard/#/" rel="nofollow noreferrer">http://myhost:8080/dashboard/#/</a> </p>
  
  <p>I don't know how to configure Traefik so that going to <a href="https://myhost/traefik" rel="nofollow noreferrer">https://myhost/traefik</a> redirects me to <a href="https://myhost:8080/dashboard/#/" rel="nofollow noreferrer">https://myhost:8080/dashboard/#/</a> without failure.... </p>
  
  <p>I'm using Traefik v1.5.1/cancoillotte and Docker version 17.12.0-ce, build c97c6d6</p>
  
  <hr>
  
  <p>UPDATE :</p>
  
  <p>I'm now using this <code>run_traefik.sh</code> :</p>
  
  <pre><code>#!/bin/bash
  
  docker run \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v $PWD/traefik.toml:/traefik.toml \
    -v $PWD/acme.json:/acme.json \
    -p 80:80 \
    -p 443:443 \
    --network proxy_network \
    --name traefik \
    traefik:1.5.1-alpine --web --docker --docker.domain=docker.localhost --logLevel=DEBUG
  </code></pre>
  
  <p>And this <code>traefik.toml</code> :</p>
  
  <pre><code>defaultEntryPoints = ["http", "https"]
  
  [entryPoints]
   [entryPoints.http]
   adress = ":80"
   [entryPoints.https]
   adress = ":443"
     [entryPoints.https.tls]
  
   [entrypoints.api]
     address=":8081"
       [entryPoints.api.auth]
       [entryPoints.api.auth.basic]
           users = ["admin:$apr1$2Z7qoaOC$lCGDDfRCWWJrkJUrdJotW1"]
  
   [entrypoints.dashboard]
    address=":8080"
  
  #Activate API and Dashboard
  [api]
  entrypoint="api"
  
  [file]
    [backends]
      [backends.backend1]
        [backends.backend1.servers.server1]
        url = "http://127.0.0.1:8081"
  
      [backends.backend2]
      [backends.backend2.servers.server1]
      url = "http://127.0.0.1:8080"
  
    [frontends]
      [frontends.frontend1]
      entrypoints=["dashboard"]
      backend = "backend2"
        [frontends.frontend1.routes.test_1]
        rule = "PathPrefixStrip:/traefik;PathPrefix:/traefik"
  
  [acme]
   email = "myemail@provider.com"
   storage = "acme.json"
   entryPoint = "https"
   onHostRule = true
   onDemand = false
   [acme.httpChallenge]
     entryPoint = "http"
  
  [docker]
   domain = "docker"
   endpoint = "unix:///var/run/docker.sock"
   watch = true
  </code></pre>
  
  <p>Trying to access <a href="http://myhost/traefik/" rel="nofollow noreferrer">http://myhost/traefik/</a> nows redirect me to <a href="http://myhost/traefik/#/" rel="nofollow noreferrer">http://myhost/traefik/#/</a>. I can see the dasboard UI but not the content. </p>
  
  <p>I mean that the page is empty except for the navigation menu. I can access the health section and see some graphs though, but I can't see any frontend or backend. 
  Of  course when exposing port 8081 in <code>docker run</code> I can access the dashboard at <a href="http://myhost:8081/dashboard/#/" rel="nofollow noreferrer">http://myhost:8081/dashboard/#/</a> and see all the frontends and backends.</p>
  
  <p>Any insight ? </p>