Setup free SSL with Let’s Encrypt and Nginx

If you search Google for “free SSL”, there are many companies provide you a free trial SSL for only 90 days or less. After that, you will have to pay.

Now, thanks to Let’s Encrypt. It’s no longer needed.
You can claim your own SSL certificate for free!

In this post, I will show you how to create your own free SSL certificate with
Let’s Encrypt and setup it with nginx.

 1. Install Let’s Encrypt

It’s recommended to run Let’s Encrypt on Linux.

The setup process is very simple, just clone it from Github:

git clone 

Then, navigate to letsencrypt folder and start the program to automatically setup everything.

cd letsencrypt ./letsencrypt-auto

Run this command to create your SSL certificate:

./letsencrypt-auto certonly --standalone --email -d -d 

Don’t forget to replace as your own domain address.

Your certificate now available in /etc/letsencrypt/live/

 3. Setup nginx to use created certificate

Now, use your favorite editor and open /etc/nginx/sites-available/default file,
add the config below right after your port 80 config:

server {  
    listen 443;
    server_name localhost;
    root html;
    index index.html index.htm;
    ssl on;
    ssl_certificate /etc/letsencrypt/live/;
    ssl_certificate_key /etc/letsencrypt/live/;
    ssl_session_timeout 1d;
    ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_trusted_certificate /etc/letsencrypt/live/;
    location / {
        try_files $uri $uri/ =404;

 4. Finish

Now you can save the file and restart nginx to see the result:

service nginx stop service nginx start

Now read this

Multiple binaries in a Rust project

If you have a project that needs to compile into multiple binaries or libraries, you can config it in Cargo.toml like this: ... [[lib]] name = "<your-lib-name>" src = "<path-to-source>" [[bin]] name =... Continue →

Subscribe to The Full Snack Developer

Don’t worry; we hate spam with a passion.
You can unsubscribe with one click.