I have two Node applications running on a DigitalOcean Droplet. These are personal side projects for learning, so some best-practices are being intentionally ignored for this exercise. The goal, is to get SLL certs acquired and auto-renewing for both. So I have:
ApplicationFoo running on both ports 80 and 443 (static and API service)
ApplicationBar running on port 8080 (just an API)
I am certain that I have my DNS settings set up correctly for both of these applications,
api.bar.com both point to the IP address of this Droplet.
I found a tutorial on the DigitalOcean website: here it is
But it doesn't work. When I run the following command:
letsencrypt certonly --webroot -w /home/bar/api/public -d api.bar.com
I get the following awful response:
Domain: api.bar.com Type: unauthorized Detail: Invalid response from https://foo.com/.well-known/acme-challenge/some_crazy_hash [correct.ip.address]: 404
Well of course it won't work if
foo.com is responding to requests for cert authorization for
bar.com! How can I get this all to play nicely together so I can have these services both running on a single Droplet?
Motivation: prevent doubling my cost to run extra Droplets for learning/experimenting projects.