When I ran the command sudo ./init-letsencrypt.sh to generate the certificate there was notice: "
IMPORTANT NOTES:
Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/domain.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/domain.com/privkey.pem
Your certificate will expire on 2021-08-06. To obtain a new or
tweaked version of this certificate in the future, simply run
certbot again. To non-interactively renew all of your
certificates, run "certbot renew "
But there is no letsencrypt file created in /etc/ and I got a 502 Bad Gateway error when accessing https
Here is my nginx .conf:
upstream fastcgi_backend {
server php:9000;
}
server {
server_name domain.com www.domain.com;
listen 80;
set $MAGE_ROOT /var/www/html/magento2;
set $MAGE_DEBUG_SHOW_ARGS 1;
include /var/www/html/magento2/nginx.conf.sample;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
}
server {
listen 443 ssl;
server_name domain.com www.domain.com;
ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
proxy_pass http://domain.com;
}
Where did you check that? In the actual certbot docker container? Or on the host system? Because if it's the latter, you should check ./data/certbot/conf.
By the way, is it wise to use relative paths inside a Docker compose file?
Hi @Osiris i can't check in certbot docker container because certbot docker return "Exited (1)", on host system in ./data/certbot/conf already have the necessary files
It looks like I've tried it many times though added --staging flag, and now get error:
There were too many requests of a given type :: Error creating new order :: too many certificates already issued for exact set of domains: bbqfield.com,www.bbqfield.com: see https://letsencrypt.org/docs/rate-limits/
@JuergenAuer yes, my http is docker
There's a reason I have to use it, but my problem now is that I seem to have run a recent create command and have reached the limit, and my letsencrypt files are not inside and outside docker @Osiris because I did not pay attention to this part of init-letsencrypt.sh:
If you ran init-letsencrypt.sh 5 times, that would have resulted in deleting perfectly fine certificates first and then ending up in a rate limit, leaving you without any certificate in the regular directories at all.
Fortunately, if you don't want to wait, you might be able to restore the private key from /etc/letsencrypt/keys/ (which would be ./data/certbot/conf/keys/ on the filesystem outside Docker) and restore the corresponding certificate from the crt.sh: crt.sh | bbqfield.com (notice that you shouldn't use the SCT pre-certificates, but the actual certificates from crt.sh.)
There are a lot of .pem files in ./data/certbot/conf/keys/ I have tried many of the files in there but all got the error: failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch)
and download certificate as fullchain from crt.sh, Is there a way to determine if there is a matching file in it ./data/certbot/conf/keys/?
How did you download the full chain? I only get the certificate itself when clicking on the link "Certificate:" at the top of the certificate info itself.
That just gets me the certificate without chain as well for me. But as long as you have the actual certificate and not the pre-certificate, it should be fine.