Skip to content

Instantly share code, notes, and snippets.

@coder4web
Last active February 27, 2016 13:31
Show Gist options
  • Save coder4web/0f2b8775659e5e4e1019 to your computer and use it in GitHub Desktop.
Save coder4web/0f2b8775659e5e4e1019 to your computer and use it in GitHub Desktop.
How To Secure Nginx with Let's Encrypt
# ------------------------
# CentOS
# @see https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-centos-7
# ------------------------
sudo yum install git bc
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
sudo systemctl stop nginx
netstat -na | grep ':80.*LISTEN'
firewall-cmd --add-port=443/tcp
cd /opt/letsencrypt
./letsencrypt-auto certonly --standalone
sudo ls /etc/letsencrypt/live/example.com
# here must be nginx config update
sudo systemctl start nginx
# ------------------------
# Debian / Ubuntu
# @see https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-14-04
# ------------------------
sudo apt-get -y install git bc
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
sudo service nginx stop
netstat -na | grep ':80.*LISTEN'
cd /opt/letsencrypt
./letsencrypt-auto certonly --standalone
sudo ls /etc/letsencrypt/live/example.com
# here must be nginx config update
sudo service nginx start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment