This is possible and it should not be hard to setup.
First make sure that your app doesn't run on port 80 (or 443). We will use that port for web server and I will help you setup reverse proxy for app.
I recommend to change app port to something higher than 1024. Ports less than 1024 are required to be run as root because of system security...
In this example, I will use most common one -
If you use DigitalOcean DNS management for records, first make sure you added domain as
example.com and not
Open settings for domain. You should have at least following records:
A record - Name:
@ - Value: Your Droplet IP address
CNAME record - Name
app - Hostname:
And leave NS records as they're.
Now when you ping
app.example.com both should point to Droplet IP. Please note that you could have to wait before DNS record refreshes, so it maybe it'll not work right after change. You can try refreshing DNS cache on local machine (or I had experience when restarting internet modem helped, but that depends on ISP).
Login to Droplet via SSH.
You have to choose now web server. You can go with Apache or Nginx. Personally, if you don't know what to go on with and don't have experience with any of it, I would recommend Nginx. Personally, I think Nginx is easier to configure for setup you need (landing page and reverse proxy for meteor app) than Apache, but that's only personal opinion.
In case you want to go with Apache, you can follow First step of LAMP tutorial.
Yet for Nginx, go with first step of LEMP tutorial.
When you setup that, you are ready to make Virtual Hosts (or Server Blocks for Nginx).
Apache - Tutorial for Virtual Hosts.
Nginx - Tutorial for Server Blocks.
What you want is to setup one block for
example.com and one for
example.com you want to follow tutorial as it is, to make it serve some content.
app.example.com you want to make ProxyPass from
http://localhost:meteor-app-port. There is tutorial based on Nginx and Node.js that should help you. It's How To Set Up a Node.js Application for Production on Ubuntu 16.04 and you need Set Up Nginx as a Reverse Proxy Server.
When you setup it, make sure you restart Apache or Nginx and try to see does it works.
If you get into any problem or have questions, ask them, I or somebody else will try to answer it. :)