# Invalid response for ACME Challenge

**URL:** <https://community.letsencrypt.org/t/invalid-response-for-acme-challenge/120169>\
**Category:** Help\
**Created:** [April 20, 2020, 6:29pm UTC](https://community.letsencrypt.org/t/invalid-response-for-acme-challenge/120169 "2020-04-20T18:29:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ROODAY](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rooday/32/39048_2.png) [@ROODAY](https://community.letsencrypt.org/u/ROODAY)\
**Post date:** [April 20, 2020, 6:29pm UTC](https://community.letsencrypt.org/t/invalid-response-for-acme-challenge/120169/1 "2020-04-20T18:29:40Z")

</div>

My domain is: stream.quaranteen.university

I ran this command: `sudo certbot --nginx`

It produced this output:

```auto
rooday@qu-rtmp:~$ sudo certbot --nginx
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx

Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: stream.quaranteen.university
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for stream.quaranteen.university
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. stream.quaranteen.university (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://stream.quaranteen.university/.well-known/acme-challenge/r2INZuHiQNqDlcr7-XoHZhDlgOPaNGTFaL1e0R3iDss [142.93.4.82]: "<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.16.1</ce"

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: stream.quaranteen.university
   Type: unauthorized
   Detail: Invalid response from
   http://stream.quaranteen.university/.well-known/acme-challenge/r2INZuHiQNqDlcr7-XoHZhDlgOPaNGTFaL1e0R3iDss
   [142.93.4.82]: "<html>\r\n<head><title>404 Not
   Found</title></head>\r\n<body>\r\n<center><h1>404 Not
   Found</h1></center>\r\n<hr><center>nginx/1.16.1</ce"

   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.

```

My web server is (include version): nginx/1.16.1

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

My hosting provider, if applicable, is: DigitalOcean

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

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

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

Here’s what my /etc/nginx/nginx.conf looks like:

```auto
events {}

http {
        server {
                listen 80 default_server;
                listen [::]:80 default_server;
                server_name stream.quaranteen.university;
        }
}

```

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [April 20, 2020, 8:52pm UTC](https://community.letsencrypt.org/t/invalid-response-for-acme-challenge/120169/2 "2020-04-20T20:52:47Z")

</div>

> [@ROODAY](#):
>
> Here’s what my /etc/nginx/nginx.conf looks like:

There must be more to it.  
Somewhere you are returning 302 with the following address:

```nohighlight
curl -Iki http://stream.quaranteen.university/
HTTP/1.1 302 Moved Temporarily
Server: nginx/1.16.1
Date: Mon, 20 Apr 2020 20:52:07 GMT
Content-Type: text/html
Content-Length: 145
Connection: keep-alive
Location: https://www.twitch.tv/quaranteenu

```

---

<div class="post-metadata">

**Author:** ![ROODAY](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rooday/32/39048_2.png) [@ROODAY](https://community.letsencrypt.org/u/ROODAY)\
**Post date:** [April 20, 2020, 10:16pm UTC](https://community.letsencrypt.org/t/invalid-response-for-acme-challenge/120169/3 "2020-04-20T22:16:24Z")

</div>

I ended up solving the issue by using [https://certbot-dns-cloudflare.readthedocs.io/en/stable/](https://certbot-dns-cloudflare.readthedocs.io/en/stable/) and just adding the cert and key path to my nginx conf manually. There was more to my conf file but it was commented out at the time I posted this question (I had an rtmp directive in there as well and the certbot nginx plugin didn’t know how to handle it so I commented out everything but the bear minimum for a running nginx server). I should’ve updated this post sooner, thanks for taking your time though!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)\
**Post date:** [May 20, 2020, 10:16pm UTC](https://community.letsencrypt.org/t/invalid-response-for-acme-challenge/120169/4 "2020-05-20T22:16:26Z")

</div>

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