Error certbot let's encrypt ngix ubuntu 16

Hi, after i have used certbot -a webroot -w webroot -d -i apache certbot starts to make the certificate but i got this error:

The following errors were reported by the server:

Type: unauthorized
Detail: Invalid response from
[]: "\n<html

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 also tried to do with my but got the same response.


I think i have my DNS well, this problem can be due to .well-know. how can i know it?
i read a response post from @sahsanu explaining that

In that post sahsanu posted:

'Hi AngelicaGandica,

You have two problems here, the first one, as @schoen already said, you have no A record defined for domain but you have a second problem for , Let’s Encrypt can’t reach the challenge.

For the second problem, to be sure you are using the right Document Root for your domain and that the challenge file could be reached, create a test file and try to get it.

mkdir -p  /opt/mattermost/.well-known/acme-challenge/
echo -n "Testing acme-challenge" >  /opt/mattermost/.well-known/acme-challenge/test

Now use your browser to reach the test file

Or using command line:
curl -ikL

If you get the text “Testing acme-challenge” then it is ok, if you get another thing then… or the document root is not the right one or maybe your application Mattermost is doing something strange with these files.

If the problem is Mattermost application you could configure nginx to use a workaround but first, try the test.


I also tried that and this is my error

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" xml:lang="en" lang="en"><head>
    <title>404 &mdash; Not Found</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="description" content="Sorry, page not found"/>
    <style type="text/css">
        body {font-size:14px; color:#777777; font-family:arial; text-align:center;}
        h1 {font-size:180px; color:#99A7AF; margin: 70px 0 0 0;}
        h2 {color: #DE6C5D; font-family: arial; font-size: 20px; font-weight: bold; letter-spacing: -1px; margin: -3px 0 39px;}
        p {width:320px; text-align:center; margin-left:auto;margin-right:auto; margin-top: 30px }
        div {width:320px; text-align:center; margin-left:auto;margin-right:auto;}
        a:link {color: #34536A;}
        a:visited {color: #34536A;}
        a:active {color: #34536A;}
        a:hover {color: #34536A;}

    <p><a href=""></a></p>
    <h2>Page Not Found</h2>
        It seems that the page you were trying to reach does not exist anymore, or maybe it has just moved.
        You can start again from the <a href="">home</a> or go back to <a href="javascript:%20history.go(-1)">previous page</a>.

That’s give me a 404, and now im stocked, can you help me guys? Thank you.

You really need to answer there questions:

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g., so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

I ran this command:

It produced this output:

My web server is (include version):

The operating system my web server runs on is (include version):

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don’t know):

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.