title: traefik - multiple port bindings for the same host V2
body: <p>I cannot figure out how to get a simple service to be accessible by both http and https on localhost. This is my setup so far and I'm using traefik V2.xxx.</p>
  
  <p>I want to be able to hit this site using both https/http protocols (for reasons on dev machines only). The https works just fine but http does NOT. What labels do I need to add/remove/change?</p>
  
  <p><a href="http://whoami.localhost:8000/" rel="noreferrer">http://whoami.localhost:8000/</a><br>
  <a href="https://whoami.localhost:8443/" rel="noreferrer">https://whoami.localhost:8443/</a></p>
  
  <p><strong>docker-compose.yml</strong></p>
  
  <pre><code>version: "3.7"
  
  services:
  
    whoami:
      image: containous/whoami
      labels:
        - traefik.enable=true
        - traefik.http.routers.whoami.rule=Host(`whoami.localhost`)
        - traefik.http.routers.whoami.entrypoints=web,web-secure
        - traefik.http.routers.whoami.tls=true
        - traefik.protocol=http,https
  
    reverse-proxy:
      depends_on:
        - whoami
      image: traefik:v2.1.1
      ports:
        - 8000:80
        - 8443:443
        - 8001:8080
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock
        - ./traefik:/etc/traefik:ro
  </code></pre>
  
  <p><strong>traefik/traefik.toml</strong></p>
  
  <pre><code>[log]
    level = "DEBUG"
  
  [accessLog]
    filePath = "/logs/access.log"
    bufferingSize = 20
  
  [docker]
    exposedbydefault = false
  
  [api]
    dashboard = true
    insecure = true
  
  [providers]
    [providers.file]
      filename = "/etc/traefik/traefik.toml"
      watch = true
  
    [providers.docker]
      exposedbydefault = false
  
  [[tls.certificates]]
    certFile = "/etc/traefik/certs/localhost-cert.pem"
    keyFile = "/etc/traefik/certs/localhost-key.pem"
  
  [entryPoints]
    [entryPoints.web]
      address = ":80"
  
    [entryPoints.web-secure]
      address = ":443"
  </code></pre>
  
  <p><strong>C:\Windows\System32\drivers\etc\hosts</strong></p>
  
  <pre><code>127.0.0.1 whoami.localhost
  </code></pre>