The procedure to secure the website with SSL encryption is well documented in the DigitalOcean tutorial.
- Basic configuration of a Ubuntu webserver
- Webdomain, DNS and location on the Server
- Configure NGINX to serve a website
Make sure you have:
- DNS-records for both webdomain.com and www.webdomain.com.
- server_name website.com www.website.com; included in your NGINX server block.
Get SSL certificate
With verything in place, Certbot will provide an SSL certificate through an nginx plugin, that will take care of reconfiguring the server block and reloading the config. The first command below will run the plugin, the second will check for automatic renewal of all your certificates.
$ sudo certbot --nginx -d webdomain.com -d www.webdomain.com $ sudo certbot renew --dry-run