Skip to content

Instantly share code, notes, and snippets.

@ngtrieuvi92
Created June 2, 2020 11:15
Show Gist options
  • Save ngtrieuvi92/6f19f2cb5e497d38c71c107901b3b6bd to your computer and use it in GitHub Desktop.
Save ngtrieuvi92/6f19f2cb5e497d38c71c107901b3b6bd to your computer and use it in GitHub Desktop.
[Let's Encrypt for Nginx on Ubuntu 16.04 - SSL Config] #ssl #https #letencrypt
# Install certbot
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
# Setting up Nginx
# Set server_name for your site
sudo nano /etc/nginx/sites-available/default
. . .
server_name example.com www.example.com;
. . .
# Obtaining an SSL Certificate
sudo certbot --nginx -d example.com -d www.example.com
# Auto renew
certbot renew --pre-hook "service nginx stop" --post-hook "service nginx start"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment