Created
June 2, 2020 11:15
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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