Host unrelated site on subdomain of a meteor app


#1

Say, I have my meteor app on app.com through Galaxy. Can I serve a totally unrelated site on unrelated.app.com, from a completely different hosting?
What should be the DNS config and stuff?


#5

Yes - I’d recommend against deploying your first app using a naked domain (app.com), but instead use something like www.app.com. You could then easily deploy a second app using unrelated.app.com.

For DNS instructions, check the “How do I configure DNS?” help section once logged into Galaxy.


#6

What’s the diff bw www.app.com and app.com?


#7

See http://www.yes-www.org/why-use-www/.

Using www. will also make your life much easier when hosting with Galaxy - they go into more detail on this in the Galaxy “How do I configure DNS?” help section.


#8

And if I use www.app.com, can I serve landing.app.com from the same container (and avoid paying double price)?


#9

There is a 1 app per container limit in place so you wouldn’t be able to have an app deployed at www.app.com and another deployed at landing.app.com, on the same container. As for possibly having one app deployed that handles both URLs, and serves up different content depending on that URL, I also don’t think that’s possible (but haven’t tried). When your DNS CNAME record is updated to point to galaxy-ingress.meteor.com, Galaxy needs to know which app to send people to. This is handled by looking at the requested domain name and matching it with an app deployed to the same domain name (the domain name that the app was deployed to using DEPLOY_HOSTNAME=galaxy.meteor.com meteor deploy [hostname]). If you try to deploy with the 2 different hostnames, you’ll end up with 2 apps on 2 containers.

There might be a workaround for all of this though, so it’s best to reach out to Galaxy Support directly.


#10

Ok, nice to know. Thanks :thumbsup:

Could you advise for this scenario: say, my app is down for maintenance or by china hakkers - I’d like to quickly put up a simple static page saying ‘app is under maintenance’ - is there a simple way to do that?


#11

Normally I’d recommend just having a static HTML maintenance page somewhere that you could quickly update your web server / proxy to redirect all incoming requests to, as needed. In the case of Galaxy though we don’t have this kind of control. It would be great if Galaxy offered something similar to Heroku’s Maintenance Mode, but they don’t (yet anyways). In the meantime I’d recommend looking at Amazon’s Route 53 DNS service. They have DNS failover options so if your site is unreachable you can automatically redirect users to a temporary maintenance site somewhere else.

All of the above being said, if your app has completely crashed and it’s taken you by surprise, then you might want to consider deploying a small “maintenance mode” app (to replace your main app). This way you’re at least showing visitors something while you work on the issue (via a dev or staging instance of your application somewhere else, that’s pointing to your production database).