How to configure Nginx with Let’s Encrypt on CentOS 8

To configure Nginx with Let’s Encrypt on CentOS 8

  1. Install certbot:
sudo yum install certbot-nginx
  1. Obtain a SSL certificate:
sudo certbot --nginx
  1. Follow the prompts to enter your email address and agree to the terms of service
  2. Choose the domain name you want to generate the certificate for.
  3. The certbot will configure Nginx to use the new SSL certificate
  4. Verify that the SSL certificate is working by visiting your website with https://
  5. To automatically renew the certificate, you can set up a cron job to run the following command:
sudo certbot renew --nginx

This command will check for expiring certificates and renew them automatically.

(mnspas)

Leave a Comment