title: Caddy - Setting HTTPS on local domain
body: <p>I would like to add HTTPS to my local domain, however we can't do this on localhost. </p>
  
  <p>My website goes fine when I run with this Caddyfile</p>
  
  <pre><code>localhost:2020 {
    bind {$ADDRESS}
    proxy / http://192.168.100.82:9000 {
      transparent
    }
  }
  </code></pre>
  
  <p>But I would like to name this website or at least enable HTTPS on it. According to Caddy, you can't do this on localhost, but what if I have a domain name ?</p>
  
  <p>I have tried using my own local address with this Caddyfile</p>
  
  <pre><code>192.168.100.26 {
    bind {$ADDRESS}
    proxy / http://192.168.100.82:9000 {
      transparent
    }
  }
  </code></pre>
  
  <p>All works fine but I still don't have HTTPS...</p>
  
  <p>And when I try to add a random domain name for example</p>
  
  <pre><code>www.mycaddytest.com {
    bind {$ADDRESS}
    proxy / http://192.168.100.82:9000 {
      transparent
    }
  }
  </code></pre>
  
  <p>I got the following error </p>
  
  <pre><code>Activating privacy features...2016/08/18 11:53:26 [www.mycaddytest.com] failed to get certificate: acme: Error 400 - urn:acme:error:connection - DNS problem: NXDOMAIN looking up A for www.mycaddytest.com
  Error Detail:
  Validation for www.mycaddytest.com:80
  Resolved to:
  
  Used: 
  </code></pre>
  
  <p>I know this error is dues to an unexisting domain name, but is there a way to deal with ?</p>
  
  <p>Just getting HTTPS on localhost or ip address will be enough</p>