Skip to content

securing nginx with SSL

nginx


securing nginx with SSL

Pre-requisites: - A records setup correctly for both domain_name and www.domain_name - A valid nginx server blocks has been configured on your server

Install certbot

sudo apt install certbot python3-certbot-nginx

Verify nginx configuration:

sudo nginx -t

Make sure that nginx is allowed on HTTP and HTTPS ports in ufw:

sudo ufw status

Obtain an SSL certificate:

sudo certbot --nginx -d cliftonbartholomew.co.za -d www.cliftonbartholomew.co.za

Test the status of the SSL renewal timer:

sudo systemctl status certbot.timer

To test the renewal process, you can do a dry run with certbot:

sudo certbot renew --dry-run

See also