0

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, www.foo.com and 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.

Steverino
  • 133
  • 1
  • 7
  • How have you configured your web server? What is it? – Michael Hampton Jul 10 '19 at 17:02
  • Yes, everything is working. I figured it out moments after posting this question. You can register the cert for the domain pointing to the secondary server using the static service of the first. I was trying to figure out how to force letsencrypt to send the cert for the second server/domain to the second server over the second server's port, which is pointless. – Steverino Jul 10 '19 at 17:12

0 Answers0