title: Using certbot to apply Let's Encrypt Certificate: Failed authorization procedure
body: <p>I am using certbot to apply <code>Let's Encrypt</code> certificate,
  my server is centos <code>7.2</code> and nginx <code>1.11.9</code>.
  what does this mean below?</p>
  
  <pre><code>[root@test ~]# certbot certonly --webroot -w /var/www/www.example.com -d example.com -d www.example.com
  
  Failed authorization procedure. example.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://example.com/.well-known/acme-ch
  &lt;head&gt;&lt;title&gt;404 Not Found&lt;/title&gt;&lt;/head&gt;
  &lt;body bgcolor="white"&gt;
  &lt;center&gt;&lt;h1&gt;404 Not Found&lt;/h1&gt;&lt;/center&gt;
  &lt;hr&gt;&lt;center&gt;", www.example.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://www.example.com/.well-known/acme-challenge/k
  &lt;head&gt;&lt;title&gt;404 Not Found&lt;/title&gt;&lt;/head&gt;
  &lt;body bgcolor="white"&gt;
  &lt;center&gt;&lt;h1&gt;404 Not Found&lt;/h1&gt;&lt;/center&gt;
  &lt;hr&gt;&lt;center&gt;"
  
  IMPORTANT NOTES:
   - If you lose your account credentials, you can recover through
     e-mails sent to example@example.com.
   - The following errors were reported by the server:
  
     Domain: example.com
     Type:   unauthorized
     Detail: Invalid response from
     http://example.com/.well-known/acme-challenge/wGNv57IGJjHQ9wyzzALktpNaPzfnTtN3m7u3QuO4p40:
     "&lt;html&gt;
     &lt;head&gt;&lt;title&gt;404 Not Found&lt;/title&gt;&lt;/head&gt;
     &lt;body bgcolor="white"&gt;
     &lt;center&gt;&lt;h1&gt;404 Not Found&lt;/h1&gt;&lt;/center&gt;
     &lt;hr&gt;&lt;center&gt;"
  
     Domain: www.example.com
     Type:   unauthorized
     Detail: Invalid response from
     http://www.example.com/.well-known/acme-challenge/kFJ0CSuKOdgcT2xmciB4GGNCcnUPoIbpQmA9jOII_Bk:
     "&lt;html&gt;
     &lt;head&gt;&lt;title&gt;404 Not Found&lt;/title&gt;&lt;/head&gt;
     &lt;body bgcolor="white"&gt;
     &lt;center&gt;&lt;h1&gt;404 Not Found&lt;/h1&gt;&lt;/center&gt;
     &lt;hr&gt;&lt;center&gt;"
  
     To fix these errors, please make sure that your domain name was
     entered correctly and the DNS A record(s) for that domain
     contain(s) the right IP address.
   - Your account credentials have been saved in your Certbot
     configuration directory at /etc/letsencrypt. You should make a
     secure backup of this folder now. This configuration directory will
     also contain certificates and private keys obtained by Certbot so
     making regular backups of this folder is ideal.
  </code></pre>
  
  <p>I can access <code>example.com</code> and <code>www.example.com</code>,and there is a note in docs: <a href="https://certbot.eff.org/#centosrhel7-nginx" rel="noreferrer">https://certbot.eff.org/#centosrhel7-nginx</a></p>
  
  <blockquote>
    <p>Note:
    To use the webroot plugin, your server must be configured to serve files from hidden directories. If /.well-known is treated specially by your webserver configuration, you might need to modify the configuration to ensure that files inside /.well-known/acme-challenge are served by the webserver.</p>
  </blockquote>
  
  <p>Is that the reason?
  How to modify the configuration?</p>