I missed a configuration on my Centos 7 / Nginx server and to try to fix it, I removed all issued (and valid) certificates and cleaned all the files. But now, after trying to reinstall, I get the warning of issued certificate limits.
Is there any way I can reinstall the same certificates that already existed, or after removing the keys, it was already and I will have to wait for the term to be able to reinstall?
Thanks for any help. And if you have any link with guidelines, thank you too.
Thankful.
Luiz De Paula
Brazil
PS: I’m sorry for the translation via Google Translate! ;O/
It produced this output:
Waiting for verification…
Cleaning up challenges
An unexpected error occurred:
There were too many requests of a given type :: Error finalizing order :: too many certificates already issued for exact set of domains: *.maridoperfeito.com.br: see https://letsencrypt.org/docs/rate-limits/
Please see the logfiles in /var/log/letsencrypt for more details.
My web server is (include version):
Centos 7 whit Nginx version 1.14.0
The operating system my web server runs on is (include version):
Centos 7
My hosting provider, if applicable, is:
Cloud Google Computer
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 installation of certificates was successful, but there is no nginx configuration that will make my sites work again.
Does anyone use the combination Centos 7 + Nginx + Wordpress Multisite + Lets Encrypt Wildcard, with dynamic mode so you do not have to tinker with files when creating sub domains?
In your server blocks, both (for port 80 and port 443) change this:
server_name maridoperfeito.com.br;
to this:
server_name .maridoperfeito.com.br;
Adding a dot in front of your domain name will tell nginx that the server name is maridoperfeito.com.br or *.maridoperfeito.com.br. Remember to restart your nginx.
Regarding WordPress MultiSite I don't use it so I've no idea whether you need to change the conf or whether it will work out of the box.
I was able to put the site online again and reconfigure the certificates. Only thing I do not hit yet, is redirected to https. As an example, if you enter only test.maridoperfeito.com.br, it will return the 404 error, but if you type https://test.maridoperfeito.com.br, the site loads normally.
I’ll leave my new config files for friends to take a look at and tell me where I’m still missing.
Thank you all!
File maridoperfeito.conf
server {
server_name maridoperfeito.com.br www.maridoperfeito.com.br *.maridoperfeito.com.br;
client_max_body_size 64m;
access_log /usr/share/nginx/html/maridoperfeito.com.br/logs/access.log;
error_log /usr/share/nginx/html/maridoperfeito.com.br/logs/error.log;
location / {
root /usr/share/nginx/html/maridoperfeito.com.br;
index index.php index.html index.htm;
if (-f $request_filename) {
expires 30d;
break;
}
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
}
location ~ .php$ {
fastcgi_pass localhost:9000; # port where FastCGI processes were spawned
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/maridoperfeito.com.br$fastcgi_script_name; # same $
fastcgi_param PATH_INFO $fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/maridoperfeito.com.br-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/maridoperfeito.com.br-0001/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = maridoperfeito.com.br) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = www.maridoperfeito.com.br) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = *.maridoperfeito.com.br) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name .maridoperfeito.com.br;
return 404; # managed by Certbot
}
if ($host ~ .*.maridoperfeito.com.br) {
return 301 https://$host$request_uri;
} # managed by Certbot
The problem is that you are using the nginx plugin to modify your conf and I don't know what would be the effects of modify these statements but indeed, all this block:
server {
if ($host = maridoperfeito.com.br) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = www.maridoperfeito.com.br) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = *.maridoperfeito.com.br) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name .maridoperfeito.com.br;
return 404; # managed by Certbot
}
Should be just like this:
server {
listen 80;
server_name .maridoperfeito.com.br;
return 301 https://$host$request_uri;
}
I've never used certbot with nginx installer so I don't know what will happen the next time you try to renew your cert, don't know whether certbot will add again the redirections or just simply ignore it, maybe @schoen or @joohoi could give you a better advice.
Thanks so much for the help you gave me, and I hope it helps other people too.
The tips worked perfectly, both main domain and sub domains, loading with https!