Setup FREE ssl using cerbot in ubuntu server and Nginx

Today, I experienced an issue on my SSL cert of one of my domain. Finally I decided to use open SSL for my domain. To setup that I had to install "Cerbot" in my ubuntu. I hope you aleady installed Nginx in your machine.

Step 1 -- Installing Certbot

sudo apt install certbot python3-certbot-nginx

Step 2 -- setting up your virtualhost

Here is my virtualhost named roopz.club

server {
        root /var/www/html/roopz-club-client/__sapper__/build;
        index index.html index.htm index.nginx-debian.html;
        server_name roopz.club www.roopz.club;
        location / {
            proxy_pass         http://localhost:3000;
        }
}

Step 3 -- Allowing HTTPS Through the Firewall

If you use UFW firwall - dont forget to allow https requests. Run the following command to open the firewall fr https requests.

sudo ufw allow 'Nginx Full'
sudo ufw delete allow 'Nginx HTTP'

Step 4 -- Get your SSL Certificate

sudo certbot --nginx -d roopz.club -d www.roopz.club

Renewal of SSL

sudo certbot renew --dry-run

Enjoy!

  • Roopz © 2020