Skip to content

Instantly share code, notes, and snippets.

@khairulcs
Created May 6, 2022 00:02
Show Gist options
  • Save khairulcs/db867ba63c366c37da4abc96b6943908 to your computer and use it in GitHub Desktop.
Save khairulcs/db867ba63c366c37da4abc96b6943908 to your computer and use it in GitHub Desktop.
Using Free Let’s Encrypt SSL/TLS Certificates with NGINX

apt-get update sudo apt-get install certbot apt-get install python3-certbot-nginx


server {
    listen 80 default_server;
    listen [::]:80 default_server;
    root /var/www/html;
    server_name example.com www.example.com;
}

nginx -t && nginx -s reload


sudo certbot --nginx -d example.com -d www.example.com


crontab -e

0 12 * * * /usr/bin/certbot renew --quiet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment