English 中文(简体)
多个领域,通过显示不同内容的名人对单一Heroku铁路进行跟踪?
原标题:Multiple domains pointing to single Heroku Rails app via nameservers displaying different content?

我们有3个铁路机,使用户能够形成一个线索,并使用一个子域。 例如:

  • user1.app.com
  • user2.app.com
  • user3.app.com

现在,他们想把自己的域名贴在自己的位置上,例如www.user1.com/显示user1.app.comwww.user1.com/my-content/显示user1.app.com/my-content/。 他们能否简单地改变姓名,告诉我们,我们处理路线问题? 我担心,如果用户除了改变姓名外,还必须做任何国家安全局的配置,那么这将是一场交易会。

感谢!

最佳回答

你们首先需要把他们放在www.user1.com上,以提及代理.heroku.com(或确定你自己的名字进入代理.heroku.com,然后让他们把自己的领域点名到这里),然后,你们需要把自己的习俗领域登记在你们的库库里,以便正确应用在存放于他们的账户的Heroku? 在您的申请中,可以与收到的申请相匹配。

这一技术在Locosy Railways CMS中应用,因此,I d建议研究这一方法,即使用Heroku gemINSIDE,因此可以通过现场管理人添加习惯领域,而现场管理人则与Heroku Arc公司进行会谈,在应用中增加习俗领域。

问题回答

This is really two questions. So I guess I ll answer it like that.

www.un.org/Depts/DGACM/index_spanish.htm 我如何允许客户在我的“oku”评估中增加一个习惯领域?

因此,例如,其域名为<编码>www.user1.com。

Two things need to happen

  1. www.user1.com needs to be added to your heroku domains for the app
  2. the dns for www.user1.com needs to be set to the heroku servers

In order to add this new domain, I guess you need to store the custom domain in the app, and when it is changed, or created, ensure a queued task is setup to push this config change to heroku.

In order to do the dns correctly, I hope it is enough that they add a CNAME for user1.app.com. Therefore, if you have a wildcard CNAME linking to heroku s dns, you can avoid the type of downtime that can occur if Heroku gets DOS-ed again.

How can I show content based on domain, rather than just subdomain?

确实,你已经将<代码>用户1.app.com与user2.app.com区分开来。

Maybe you just sniffed request.host. Now you just have to try the custom domain first.

或许这支空洞的工作。

before_filter :set_client

def set_client
  @client = Client.find_by_custom_domain(request.host) || Client.find_by_subdomain(request.host.split(".").first)
  unless @client
    raise "unrecognised domain #{request.host}"
  end
end




相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...