Host unrelated site on subdomain of a meteor app

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?

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.

Whatā€™s the diff bw www.app.com and app.com?

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.

1 Like

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

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.

1 Like

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?

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).

1 Like