sudo yum install certbot
You need to execute the command one time
certbot certonly -d example.com,example.org,subdomain.example.com --webroot --webroot-path /srv/www/example.com/webroot -m [email protected] --agree-tos --no-eff-email
List of all parameters: https://certbot.eff.org/docs/using.html#certbot-command-line-options If everything went well, in the console we will get info with the paths to the certificate files (fullchain.pem and privkey.pem).
Add it to the config
listen ip_адрес_сервера:443 ssl;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
sudo nginx -s reload
Add to cron (for example, once a day):
0 11 * * * root certbot renew 2>&1 ; nginx -s reload 2>&1
sudo certbot renew
2. View information about all installed certificates on the server (shows sites, paths with keys, time to end):
sudo certbot certificates