Using SSL encryption on your website or blogs to protect user’s privacy is not a bad idea. In fact, Google recommends it.
Google announced few months back, that if you migrate to your websites and blogs to HTTPS, you may get a small bump on its search engine result pages.
Adding SSL encryption also cost money depending on the certificate you want to install. For those who are not making enough money from their websites or blogs but still want to add SSL certificates can use LetsEncrypt.
LetsEncrypt is a free open certificate authority (CA) that provides free certificates for websites and other services.
For more about who behind this, check their page here.
This brief tutorial is going to show you how to easily get LetsEncrypt’s certificates working on Ubuntu for your Nginx webservers.
The first thing to do is to clone the git project to your server. This means downloading the required packages from git to your server.
If you don’t already have git installed, you must install it first. To do that, run the commands below.
sudo apt-get install git
Next, clone LetsEncrypt git project to your server.
git clone https://github.com/letsencrypt/letsencrypt
Then change into the project folder.
When you’re there, run the commands below to generate a SSL certificate for your website or blogs.
./letsencrypt-auto certonly -a standalone -d example.com -d www.example.com
LetsEncrypt puts its keys in this directory /etc/letsencrypt
The final thing to do after generating the certificates is to configure Nginx webserver to use the cert.
More on installing certificate on Ubuntu server for Nginx can be found on this blog post
Example configuration for Nginx webserver is as followed:
listen 443 ssl spdy;
listen [::]:443 ssl spdy;
ssl_protocols TLSv1.1 TLSv1.2;
add_header Strict-Transport-Security max-age=15768000;
resolver 22.214.171.124 126.96.36.199 valid=86400;
Save your configuration and restart Nginx webserver.
That’s it! If everything is setup correctly, your site should be SSL enabled for free.