Question

How do I set up a subdomain to run with Meteor?

Hi,

I am running meteor with Nginx on my Ubuntu droplet, and would like to configure a subdomain to serve up static files at media.my-app-name.com. The DNS tutorial worked a treat, but my attempts to use the tutorial on NGINX config here was unsuccessful. Upon running service [my app name] restart, the process fails.

Attempts to work around this issue came up short. For example, adding another server { } block (with the relevant other info) into the preexisting nginx config file, disabling the default_server setting and trying various approaches that way didn’t work. The closest I got was to get the Meteor app mirrored on my subdomain, instead of serving up the files at the public_html document root given in the tutorial.

Of course, I noticed the comment in the nginx config saying “root is irrelevant,”—now that’s where I’m stuck. Googling didn’t turn up any further info to help with that. So, I would be deeply thankful if someone could point me in the right direction. I’m so close to launching this app, a year in the making, and I need a lifeline.

Yours very truly,

David

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi Ryan,

I managed to resolve this issue, thanks to reading the tutorial here. Turns out running a separate subdomain wasn’t necessary (though it is certainly possible). Instead, I just needed to understand how block and location selection works in nginx.

Thanks for reaching out! :)