Letsencrypt Auto Renew Failed Under Nginx (LNMP)

Just found SSL not working for  https://www.eyewearcanada.com . This glasses shop is using an LNMP environment (Linux, Nginx, MySQL, and PHP), I am using the free Let’s Encrypt.  I have tried to run:

lnmp ssl add

I still can not add Let’s Encrypt successfully. So I deleted the vhost by run:

lnmp vhost del

and re-add this vhost, I got the following errors:

nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
Reload Nginx……
nginx: [emerg] cannot load certificate “/usr/local/nginx/conf/ssl/www.eyewearcanada.com/fullchain.cer”: BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen(‘/usr/local/nginx/conf/ssl/www.gloryeyewear.com/fullchain.cer’,’r’) error:2006D080:BIO routines:BIO_new_file:no such file)

I googled the error message and found the method: restart Nginx!!!

Here are the steps what we should do if we meet such issues:

1 lnmp vhost del   // del the vhost which SSL is not working;

2 lnmp restart  // restart lnmp /nginx;

3 lnmp vhost add  //re-add this vhost, take care, no need to generate a new MySQL database!!!

If we are using the hosting from hostgator, nexcess, and other web hosting, we also can in simple way: stop SSL,  restart nginx, and re-install SSL.

 

Note:
acme.sh remove www.domain.com
Remove a domain name’s SSL by the above command line.