Skip to content

Instantly share code, notes, and snippets.

@alphamarket
Created October 11, 2019 10:29
Show Gist options
  • Save alphamarket/0333d5f20c2ee16a45b25c9a30442f15 to your computer and use it in GitHub Desktop.
Save alphamarket/0333d5f20c2ee16a45b25c9a30442f15 to your computer and use it in GitHub Desktop.
Creating HTTPS certification using certbot & nginx
#!/bin/bash
# adding certbot PPA
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
# install the certbot
sudo apt-get install certbot python-certbot-nginx
# select the site listed in nginx's site-enable
# to make a cert keys for the site
sudo certbot --nginx
# installation reference: https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx
# the followings will be added to your nginx site's
# config file auto matically
# ssl_certificate /etc/letsencrypt/live/yoursite.com/fullchain.pem; # managed by Certbot
# ssl_certificate_key /etc/letsencrypt/live/yoursite.com/privkey.pem; # managed by Certbot
# [EXTRA!]
# to add the maximum encryption quality to your site add the followings to your site's config file
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# ssl_prefer_server_ciphers on;
# ssl_dhparam /etc/ssl/certs/dhparam.pem;
# ssl_ciphers '-ALL:EECDH+aRSA+AESGCM:EDH+aRSA+AESGCM:EECDH+aRSA+AES:EDH+aRSA+AES';
# ssl_session_timeout 1d;
# ssl_session_cache shared:SSL:50m;
# ssl_stapling on;
# ssl_stapling_verify on;
# you can now test you site's encryption quality from sites like below.
# https://www.ssllabs.com/ssltest/analyze.html?d=yoursite.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment