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. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.
My domain is: booking-api.spotzerstaging.eu
I ran this command: sudo ./certbot-auto certonly --webroot -w apps/simple-booking-api -d booking-api.spotzerstaging.eu --debug-challenges
It produced this output:
Domain: booking-api.spotzerstaging.eu
Type: unauthorized
Detail: Invalid response from
http://booking-api.spotzerstaging.eu/.well-known/acme-challenge/hmuJX-S4lXIyPcyRujkJbxbjAlnDZ9aXl6zmXl1_Cug
[108.129.68.91]: “\r\n404 Not
Found\r\n<body bgcolor=“white”>\r\n
404
Not Found
\r\n”
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.12.2
The operating system my web server runs on is (include version): AWS Linux 2
My hosting provider, if applicable, is: AWS
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 1.4.0
Nginx conf:
server {
listen 80;
server_name booking-api.spotzerstaging.eu;
location ~ /.well-known {
allow all;
root /usr/share/nginx/html;
}
location / {
proxy_pass http://localhost:2020;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Additional Info from letsencrypt logs:
{
“identifier”: {
“type”: “dns”,
“value”: “booking-api.spotzerstaging.eu”
},
“status”: “invalid”,
“expires”: “2020-05-18T11:29:29Z”,
“challenges”: [
{
“type”: “http-01”,
“status”: “invalid”,
“error”: {
“type”: “urn:ietf:params:acme:error:unauthorized”,
“detail”: “Invalid response from http://booking-api.spotzerstaging.eu/.well-known/acme-challenge/hmuJX-S4lXIyPcyRujkJbxbjAlnDZ9aXl6zmXl1_Cug [108.129.68.91]: “\u003chtml\u003e\r\n\u003chead\u003e\u003ctitle\u003e404 Not Found\u003c/title\u003e\u003c/head\u003e\r\n\u003cbody bgcolor=\“white\”\u003e\r\n\u003ccenter\u003e\u003ch1\u003e404 Not Found\u003c/h1\u003e\u003c/center\u003e\r\n\u003chr\u003e\u003ccenter\u003e””,
“status”: 403
},
“url”: “https://acme-staging-v02.api.letsencrypt.org/acme/chall-v3/55800501/h68ouQ”,
“token”: “hmuJX-S4lXIyPcyRujkJbxbjAlnDZ9aXl6zmXl1_Cug”,
“validationRecord”: [
{
“url”: “http://booking-api.spotzerstaging.eu/.well-known/acme-challenge/hmuJX-S4lXIyPcyRujkJbxbjAlnDZ9aXl6zmXl1_Cug”,
“hostname”: “booking-api.spotzerstaging.eu”,
“port”: “80”,
“addressesResolved”: [
“108.129.68.91”
],
“addressUsed”: “108.129.68.91”
}
]
}
]
}
2020-05-11 11:29:35,281:DEBUG:acme.client:Storing nonce: 0002hBhojvy_B5g1HJqNPUrv00trJq1u_Oi5jTbyd4NxIUA
2020-05-11 11:29:35,282:WARNING:certbot._internal.auth_handler:Challenge failed for domain booking-api.spotzerstaging.eu
Have tried adding a test file but /.well-known/acme-challenge/ only serves a 404.
Adding specific routing to root in