Adding a new subdomain hosted with nginx & letsencrypt

This is how I set up the subdomain for hosting this site (notes.nowacki.org). I already had nginx and letsencrypt set up for the primary website and a few others, but it’s an uncommon-enough exercise for me that I’m writing the notes down here.

Getting started

server {
    listen 80;
    server_name notes.nowacki.org;
    root /var/www/notes.nowacki.org/htdocs;
    index index.html index.htm;
}

Enabling HTTPS

sudo certbot --nginx -d notes.nowacki.org