Body: <p>I'm trying to obtain ssl certificate for the following server: </p>
  
  <pre><code>server {
    server_name  www.nodrama.io;
    rewrite ^(.*) http://nodrama.io$1 permanent;
  }
  
  server {
    server_name  nodrama.io;
    listen 80;
    listen [::]:80 ipv6only=on;
  
    error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 420 422 423 424 426 428 429 431 444 449 450 451 500 501 502 503 504 505 506 507 508 509 510 511 /X0X.html;
    location = /X0X.html {
      root /usr/share/nginx/html/;
      internal;
    }
  
    location ~ /.well-known {
      allow all;
    }
  
    location = / {
      # temporary redirect before we server our own page
      rewrite ^/$ http://blog.nodrama.io redirect;
    }
  
  }
  </code></pre>
  
  <p>Running:</p>
  
  <blockquote>
    <p>sudo certbot --nginx -d nodrama.io -d www.nodrama.io</p>
  </blockquote>
  
  <p>I get:</p>
  
  <pre><code>Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
  Obtaining a new certificate
  Performing the following challenges:
  http-01 challenge for nodrama.io
  http-01 challenge for www.nodrama.io
  Waiting for verification...
  Cleaning up challenges
  
  IMPORTANT NOTES:
   - The following errors were reported by the server:
  
     Domain: www.nodrama.io
     Type:   unauthorized
     Detail: Invalid response from
     http://www.nodrama.io/.well-known/acme-challenge/lMEKfsPUnxowmND04ky9sXbFxUERwuna9hsMRHtBv8A:
     "&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: nodrama.io
     Type:   unauthorized
     Detail: Invalid response from
     http://nodrama.io/.well-known/acme-challenge/Wml_6nPNrPebbONMLtNbg7yUaDihATrzYluA91Era9s:
     "&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/AAAA record(s) for that domain
     contain(s) the right IP address.
  </code></pre>
  
  <p>I can access a test file:</p>
  
  <p><a href="http://nodrama.io/.well-known/acme-challenge/test.txt" rel="nofollow noreferrer">http://nodrama.io/.well-known/acme-challenge/test.txt</a>
  <a href="http://www.nodrama.io/.well-known/acme-challenge/test.txt" rel="nofollow noreferrer">http://www.nodrama.io/.well-known/acme-challenge/test.txt</a></p>
  
Comments: CC BY-SA 4.0
Comments: 2018-07-12T23:27:25.690Z
Comments: Do you see entries in the nginx log where the service is trying to access you and getting the 404 responses?
Comments: Michael - sqlbot
Comments: CC BY-SA 4.0
Comments: 2018-07-13T06:00:15.297Z
Comments: I'm getting a connection timeout on www.nodrama.io, I suspect your DNS has not the proper configuration and doesn't answer properly so the request ends on your server
Comments: Tensibai
Comments: CC BY-SA 4.0
Comments: 2018-07-13T08:32:14.490Z
Comments: DNS is just:
  nodrama.io / A / 18.217.237.232
  nodrama.io / AAAA /  2600:1f16:14a:7b00:e9ba:752c:feb8:49d5
  www.nodrama.io / CNAME / nodrama.io
Comments: fbielejec
Tags: <ssl><nginx><certbot>
Title: 404 Not Found when obtaining new certificates for nginx
UserDisplayName: fbielejec
ThreadText: # 404 Not Found when obtaining new certificates for nginx
  
  (Asked by: username_0 on 2018-07-12)
  
  I'm trying to obtain ssl certificate for the following server:
  
  ```
  server {
    server_name  www.nodrama.io;
    rewrite ^(.*) http://nodrama.io$1 permanent;
  }
  
  server {
    server_name  nodrama.io;
    listen 80;
    listen [::]:80 ipv6only=on;
  
    error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 420 422 423 424 426 428 429 431 444 449 450 451 500 501 502 503 504 505 506 507 508 509 510 511 /X0X.html;
    location = /X0X.html {
      root /usr/share/nginx/html/;
      internal;
    }
  
    location ~ /.well-known {
      allow all;
    }
  
    location = / {
      # temporary redirect before we server our own page
      rewrite ^/$ http://blog.nodrama.io redirect;
    }
  
  }
  
  ```
  
  Running:
  
  > sudo certbot --nginx -d nodrama.io -d www.nodrama.io
  
  I get:
  
  ```
  Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
  Obtaining a new certificate
  Performing the following challenges:
  http-01 challenge for nodrama.io
  http-01 challenge for www.nodrama.io
  Waiting for verification...
  Cleaning up challenges
  
  IMPORTANT NOTES:
   - The following errors were reported by the server:
  
     Domain: www.nodrama.io
     Type:   unauthorized
     Detail: Invalid response from
     http://www.nodrama.io/.well-known/acme-challenge/lMEKfsPUnxowmND04ky9sXbFxUERwuna9hsMRHtBv8A:
     "<html>
     <head><title>404 Not Found</title></head>
     <body bgcolor="white">
     <center><h1>404 Not Found</h1></center>
     <hr><center>"
  
     Domain: nodrama.io
     Type:   unauthorized
     Detail: Invalid response from
     http://nodrama.io/.well-known/acme-challenge/Wml_6nPNrPebbONMLtNbg7yUaDihATrzYluA91Era9s:
     "<html>
     <head><title>404 Not Found</title></head>
     <body bgcolor="white">
     <center><h1>404 Not Found</h1></center>
     <hr><center>"
  
     To fix these errors, please make sure that your domain name was
     entered correctly and the DNS A/AAAA record(s) for that domain
     contain(s) the right IP address.
  
  ```
  
  I can access a test file:
  
  <http://nodrama.io/.well-known/acme-challenge/test.txt>
  <http://www.nodrama.io/.well-known/acme-challenge/test.txt>
  
  **Tags:** ssl, nginx, certbot
  
  > **Comments:**
  > **username_1**: Do you see entries in the nginx log where the service is trying to access you and getting the 404 responses?  
  > **username_2**: I'm getting a connection timeout on www.nodrama.io, I suspect your DNS has not the proper configuration and doesn't answer properly so the request ends on your server  
  > **username_0**: DNS is just: nodrama.io / A / 18.217.237.232 nodrama.io / AAAA /  2600:1f16:14a:7b00:e9ba:752c:feb8:49d5 www.nodrama.io / CNAME / nodrama.io  
  
  ---
  
  ## 0 answers
  
  