title: How can I secure the traefik dashboard using SSL & basic auth?
body: <p>A have traefik set up and working for a 3 node docker swarm on DigitalOcean, and my web apps are being served just fine. I want to secure the traefik dashboard, and have gleaned some info from GitHub issues, but my attempts result in a gateway timeout when trying to access the dashboard.</p>
  
  <p>My compose file is below (auth &amp; url edited for security):</p>
  
  <pre><code>version: "3.5"
  services:
    traefik:
      image: traefik:1.6
      command:
        - --api
        - --docker
        - --docker.watch
        - --docker.swarmmode      
        - --entryPoints=Name:http Address::80
        - --entryPoints=Name:https Address::443 TLS:/run/secrets/el_cert,/run/secrets/el_key,/run/secrets/as_cert,/run/secrets/as_key
      ports:
        - 80:80
        - 443:443
      networks:
        - proxy
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock
      secrets:
        - as_cert
        - as_key
        - el_cert
        - el_key
      deploy:
        mode: global
        labels:
          - "traefik.frontend.entryPoints=http,https"
          - "traefik.frontend.headers.SSLRedirect=true"
          - "traefik.frontend.rule=Host:&lt;hostname&gt;"
          - "traefik.port=8080"
          - "traefik.frontend.auth.basic=&lt;user&gt;:&lt;password&gt;"
        placement:
          constraints: [node.role==manager]
  networks:
    proxy:
      external:
        name: proxy
  secrets:
    as_cert:
      external: true
    as_key:
      external: true
    el_cert:
      external: true
    el_key:
      external: true
  </code></pre>
  
  <p>BTW If I move the labels out from under deploy it works locally using docker-compose.</p>