I am using centos 7.4 server. you can use following commands for installing ssl certicate.
#cd /etc/nginx/conf.d/
[root@vps147238 conf.d]# cp m.eparinay.com.conf qa.eparinay.com.conf
[root@vps147238 conf.d]# vim qa.eparinay.com.conf
[root@vps147238 conf.d]# sudo certbot --nginx -d qa.eparinay.com -d qa.eparinay.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org
Attempting to parse the version 1.23.0 renewal configuration file found at /etc/letsencrypt/renewal/eparinay.com.conf with version 1.11.0 of Certbot. This might not work.
Attempting to parse the version 1.23.0 renewal configuration file found at /etc/letsencrypt/renewal/purabtech.com.conf with version 1.11.0 of Certbot. This might not work.
Attempting to parse the version 1.23.0 renewal configuration file found at /etc/letsencrypt/renewal/www.eparinay.com-0001.conf with version 1.11.0 of Certbot. This might not work.
Requesting a certificate for qa.eparinay.com
Performing the following challenges:
http-01 challenge for qa.eparinay.com
Waiting for verification…
Cleaning up challenges
Deploying Certificate to VirtualHost /etc/nginx/conf.d/qa.eparinay.com.conf
Traffic on port 80 already redirecting to ssl in /etc/nginx/conf.d/qa.eparinay.com.conf
Congratulations! You have successfully enabled https://qa.eparinay.com
IMPORTANT NOTES:
Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/qa.eparinay.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/qa.eparinay.com/privkey.pem
Your certificate will expire on 2022-07-31. To obtain a new or
tweaked version of this certificate in the future, simply run
certbot again with the "certonly" option. To non-interactively
renew all of your certificates, run "certbot renew"If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
[root@vps147238 conf.d]# vim qa.eparinay.com.conf
[root@vps147238 conf.d]# service nginx restart
Redirecting to /bin/systemctl restart nginx.service
[root@vps147238 conf.d]#