I ran this command:
sudo certbot certonly --webroot --webroot-path /home/ubuntu/autolycus -d animebob.in
It produced this output:
My web server is (include version):
ubuntu@movies3-storage:~$ sudo certbot certonly --webroot --webroot-path /home/ubuntu/autolycus -d an imebob.in
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Requesting a certificate for animebob.in
Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority report ed these problems:
Domain: animebob.in
Type: unauthorized
Detail: 129.159.20.202: Invalid response from Autolycus s7B9frqtspgjlRAsF1P-2xnN-E9fpS7vGNo: "\n<html lang="en">\n \n <meta charset ="utf-8" />\n <link rel="icon" href="/autolycus/icons/bx-meteor.svg"
Hint: The Certificate Authority failed to download the temporary challenge files created by Certbot. E nsure that the listed domains serve their content from the provided --webroot-path/-w and that files c reated there can be downloaded from the internet.
The operating system my web server runs on is (include version):
ubuntu 22.04
My hosting provider, if applicable, is:
oracle instance added 80, 443 in ingress rules
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.21.0
can someone help me pls
extra information, : i've installed with same command in other instance 1 day before, now i've deleted that instane and created a new one and trying again
using cloudflare.(no proxy option on in dns records)
Can you show us the nginx server block for the animebob.in domain? I want to check that the webroot path in your certbot command is correct given how you redirect the acme challenge request.
curl -IL animebob.in/.well-known/acme-challenge/Test123
HTTP/1.1 302 Found
Server: nginx/1.17.10
Location: /autolycus/.well-known/acme-challenge/Test123
After the above location block I suggest adding the below location and then reload nginx. This will cause the acme challenge to be processed right away and not be redirected.
I have no idea what files are present in that directory. Maybe a lot of stuff that shouldn't be accessible would be accessible to the entire world wide web? I'd recommend to proceed with caution and not to advice such root directive. (Unless absolutely sure there's nothing in it.)
Hint: The Certificate Authority failed to download the temporary challenge files created by Certbot. Ensure that the listed domains serve their content from the provided --webroot-path/-w and that files created there can be downloaded from the internet.
Personally I would use a completely separate directory such as /var/lib/letsencrypt/http_challenges/ (which is also used by the Certbot apache plugin, so probably a good fit) for the challenge directory.
I would have liked to recommend certbot certonly --nginx instead of --webroot and avoid issues with any paths. But, when I see a config with lots of proxy I am less inclined. Especially when there are other apparent issues with the config. And, when using a somewhat older certbot version as well. The --nginx plug-in would be cleaner but potentially a lot more work to get them sorted out.