What's the correct way to set up SSL for a subdomain pointing to a separate Droplet?

November 4, 2014 2k views

I have two droplets set up.

One of them is just hosting the static, public facing side of the site and Is running off of nginx. I set up the DNS and nginx so that the url looks like this: www.site.com.

I then set up another dns and droplet. The dns is set up so that request made to my.site.com (notice the subdomain) will go to the second droplet.

The second droplet is running node.js and is serving up a meteor app.

I need the subdomain on the second droplet to be served with SS: https://my.site.com.

What is the correct way to do this? Do I need to install nginx on my second droplet to get this to work?

Also worth mentioning: I didn't even need to configure nignx on my first droplet to redirect to the second droplet. It was just automatic after I set up the CNAME and A record.

1 Answer

Setting up an Nginx reverse proxy in front of the Meteor app to handle SSL is probably the best way to do this. Check out this tutorial for more info:

Also, make sure you are using a "wildcard" SSL certificate to support multiple subdomains.

by Daniel Speichert
Deploy a Meteor.js application on Ubuntu 14.04 with Nginx and MongoDB. This tutorial shows you how to build and deploy a production-ready version of your JavaScript application using the Meteor framework.
Have another answer? Share your knowledge.