Rails,Heroku和Subdomains。我的特殊情况是否可行? [英] Rails, Heroku and Subdomains. Is my special case scenario feasible?

查看:118
本文介绍了Rails,Heroku和Subdomains。我的特殊情况是否可行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我的方案:

我有一个应用程序必须支持多个客户端。每个客户端都将被给予一个服务的子域名。我们还将有一个没有应用程序的手册网站,它只是一个关于该产品的网站,以及潜在客户如何与我们建立帐户。

I have an application that will have to support multiple clients. Each client will be given a subdomain for there service. We will also have a brochure website that doesn't have the application, its just a website about the product and how potential clients can setup an account with us.

给定:

www.mycoolsite.com 将指向Heroku上的小册子应用程序。
client1.mycoolsite.com client2.mycoolsite.com client3。 mycoolsite.com 都会指向同样的SaaS应用程序,可以告诉每个请求之间的区别,我应该能够处理,所以他们只看到他们的日期(即设置一个全局 client_id 或类似的东西)

www.mycoolsite.com would point to a brochure app on Heroku. client1.mycoolsite.com, client2.mycoolsite.com and client3.mycoolsite.com would all point to the same SaaS application that could tell the difference between each request and I should be able to handle so they only see their date (i.e. setting a global client_id or something like that)

我该怎么做?我没有使用DNS做很多,所以我很开始不了解这一点。

How do I go about doing this? I haven't done a lot with DNS so I'm pretty clueless about where to start with this.

谢谢。

推荐答案

没有汗水。我们现在在Heroku这样做。我们碰巧使用Godaddy进行域名注册商,但是任何DNS控制面板都可以让您做同样的事情。

No sweat. We do that now, at Heroku. We happen to use Godaddy for the domain registrar, but any DNS control panel will let you do the same thing.

我在这里阅读的其他解释有一点一点,在这里是具体细节...

The other explanations I read here are a little general, here are the specifics...

heroku的解释非常好,在: http://docs.heroku.com/custom-domains
(甚至有一个很好的屏幕截图一步一步显示)

The explanation at heroku is very good, at : http://docs.heroku.com/custom-domains (there's even a very good screencast shows step by step)

关键是如果你的ROOT域名(mycoolsite.com)在Heroku你想要创建三个A记录,因为他们做一些容错的交叉魔法。所以你会有一个A记录

the key thing is if your ROOT domain (mycoolsite.com) is at Heroku you want to create THREE "A" records, because they do some fault-tolerant crossover magic. So you'd have an A record for

75.101.163.44
75.101.145.87
174.129.212.2

现在,为每个子域创建一个C记录

Now for each subdomain you create a C record

www  -> proxy.heroku.com
client1 -> proxy.heroku.com
client2 -> proxy.heroku.com
client3 -> proxy.heroku.com

在HEROKu方面,您有两个应用程序吗? 小册子应用程序和saas应用程序。

NOW on the HEROKu side, you have two apps right? The 'brochure app' and the saas app.

登录,并为每个应用程序转到资源 - > Addon - >获取更多插件 - >自定义域(免费)

Login, and for each app go to Resources -> Addon -> Get More Addons ->Custom Domains (free)

为小册子应用程序添加一个域名: www.mycoolsite.com

for the brochure app, add ONE domain: www.mycoolsite.com

对于saas应用程序,添加每个客户端,例如:

for the saas app, add each of the clients, eg:

client1.mycoolsite.com 
client2.mycoolsite.com 
client3.mycoolsite.com

就是这样。像一个冠军。玩得开心。

That's it. works like a champ. Have fun.

这篇关于Rails,Heroku和Subdomains。我的特殊情况是否可行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆