Adding a subdomain

That is confusing. From your prior thread I see you were not using an installer and using --webroot method. That error sounds like you tried to change from --webroot to --nginx while also --expanding. It is not clear since you omitted key parts from the command or responses to Certbot's interactive questions.

Seeing as you already created an HTTPS server block for sandbox you should probably just continue to use --webroot.

I would also get a separate cert for your sandbox domains. Having a single cert with domain names across multiple server blocks is harder to manage as you add new server blocks or remove them.

Did you also create a dedicated server block for your sandbox domains for HTTP (port 80) along the lines of my recommendation in your prior thread? You should have a server block for port 80 and a separate one for port 443.

The Certbot command is then just the same as you used earlier just with sandbox domains. Once you get the cert update the path for the ssl_certificate files to use the new cert path.

sudo certbot certonly --weboot -w (nginx root folder) -d sandbox.rpiweather.net,www.sandbox.rpiweather.net
2 Likes