SSL on multiple subdomains on the same server

My domain is: files.magicauthor.com and api.magicauthor.com

I ran this command: sudo certbot certonly -a webroot --webroot-path=/<location_to_doc_root1>/lets-encrypt-validation -d api.magicauthor.com --webroot-path=/<location_to_doc_root2>/lets-encrypt-validation -d files.magicauthor.com

It produced this output: 2 different cert directories. https://api.magicauthor.com is working fine. whereas https://files.magicauthor.com fails

I also see that https://crt.sh/?q=files.magicauthor.com doesn’t retrieve any results although the command had worked fine in the server.

I also tried the below command to replace the existing cert for files.magicauthor.com; the command completed fine but to no avail. Please help.
sudo certbot certonly -a webroot --webroot-path=/<location_to_doc_root_2>/lets-encrypt-validation -d files.magicauthor.com

My web server is (include version): nginx

The operating system my web server runs on is (include version): Ubuntu 16.04

My hosting provider, if applicable, is: DigitalOcean

I can login to a root shell on my machine (yes or no, or I don’t know): yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel): no

--webroot (without --standalone) may only work if the --webroot-path matches the root statement in your conf file.
Otherwise, let’s say:

  1. root /var/www/html/mysite
  2. –webroot-path /tmp/lets-encrypt-validation

then
http://mysite/.well-knwon/acme-challenge/string
looks for string file at:
/var/www/html/mysite/.well-known/acme-challenge/string
but string file was placed at:
/tmp/lets-encrypt-validation/.well-known/acme-challenge/string

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.