Answer the question
In order to leave comments, you need to log in
How to avoid an address call loop when renewing an SSL certificate?
The situation is as follows:
a site has MYSITE.RU
been configured by certbot to automatically obtain and renew an SSL certificate once a month. Everything worked like clockwork until I set up a forced redirect to HTTPS
. The problem is that the server issuing the SSL certificate (Let's Encrypt) tries every time to contact the address
http://MYSITE.RU/.well-known/acme-challenge/какойтодлинныйключ/код
http://MYSITE.RU/.well-known/acme-challenge/какойтодлинныйключ/код
receives the code 301
and the server sends it tohttps://MYSITE.RU/.well-known/acme-challenge/какойтодлинныйключ/код
and the bot already receives the code404
Answer the question
In order to leave comments, you need to log in
So it is not necessary to extend the redirect to .well-known
- this is standard practice.
server {
listen 80;
location /.well-known/acme-challenge {
root /var/www/letsencrypt;
}
location / {
return 301 https://$server_name$request_uri;
}
}
CertBot can also validate domains via DNS .
Give it an API key to manage the domain (if your domain is delegated to one of the well-known hosters / registrars, including Google, DigitalOcean, CloudFlare, Linode) and the bot itself creates a temporary TXT
record, checks it and generates a certificate.
Only when confirmed via DNS can wildcard certificates be created . Those. for any subdomains: *.mysite.ru
The site is not involved in this case and may even lie down.
I suspect that letsencrypt wants to place what letsencrypt wants on the second URL. Now you have nothing there and LE gets a whack. Smoke your NGINX config.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question