title: Traefik with docker-compose, LetsEncrypt, and multiple domains
body: <p>I'm trying to do a run a ghost image through <code>docker-compose</code> using traefik as the reverse proxy. </p>
  
  <p>I have two domains, <code>sub.foo.com</code> and <code>bar.com</code>. After <code>docker-compose up -d</code> is called, the container is accessible via <code>sub.foo.com:2386</code> but not <code>bar.com</code>. I know it's not necessary to have the <code>ports</code> option in the <code>ghost.service</code>, but have it there to prove the container comes up.</p>
  
  <p>Here's my configuration:</p>
  
  <hr>
  
  <p><strong>traefik.toml</strong></p>
  
  <pre><code>debug = false
  
  logLevel = "ERROR"
  defaultEntryPoints = ["https","http"]
  
  [entryPoints]
  
  [entryPoints.http]
  address = ":80"
  [entryPoints.http.redirect]
  entryPoint = "https"
  
  [entryPoints.https]
  address = ":443"
    [entryPoints.https.tls]
  
  [retry]
  
  [docker]
  endpoint = "unix:///var/run/docker.sock"
  domain = "sub.foo.com"
  watch = true
  exposedbydefault = false
  
  [acme]
  email = "john.doe@example.com"
  storage = "acme.json"
  entryPoint = "https"
  onHostRule = true
  [acme.httpChallenge]
  entryPoint = "http"
  </code></pre>
  
  <p><strong>docker-compose.yml</strong></p>
  
  <pre><code>version: "3.3"
  
  services:
    db:
      image: mysql:5.7
      volumes:
        - db_data:/var/lib/mysql
      restart: always
      networks:
        - ghost
      environment:
        MYSQL_ROOT_PASSWORD: testing
        MYSQL_DATABASE: ghost
        MYSQL_USER: ghost
        MYSQL_PASSWORD: ghost
    ghost:
      depends_on:
        - db
      image: ghost:2.1.2-alpine
      ports:
        - "2368:2368"
      networks:
        - traefik
        - ghost
      volumes:
        - ghost_data:/var/lib/ghost/content
      environment:
        database__client: mysql
        database__connection__host: db
        database__connection__user: ghost
        database__connection__password: ghost
        database__connection__database: ghost
      labels:
        - "traefik.backend=ghost"
        - "traefik.docker.network=traefik"
        - "traefik.enable=true"
        - "traefik.frontend.rule=Host:bar.com"
        - "traefik.port=2368"
        - "traefik.protocol=http"
  
  volumes:
    db_data: {}
    ghost_data: {}
  
  networks:
    ghost: {}
    traefik:
      external: true
  </code></pre>
  
  <p>Any ideas what I'm doing wrong? My DNS records are pointed identically on <code>sub.foo.com</code> and <code>bar.com</code>. When I navigate to <code>bar.com</code> I end up with:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;&lt;head&gt;
  &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8" /&gt;
  &lt;title&gt;Access Denied&lt;/title&gt;
  &lt;style type="text/css"&gt;body {margin:0;font-family:verdana,sans-serif;} h1 {margin:0;padding:12px 25px;background-color:#343434;color:#ddd} p {margin:12px 25px;} strong {color:#E0042D;}&lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;Access Denied&lt;/h1&gt;
  &lt;p&gt;
  &lt;strong&gt;You are attempting to access a forbidden site.&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;
  Consult your system administrator for details.
  &lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>which is not your standard traefik error. Is something not binding?</p>