如何使用Heroku设置自定义域名? [英] How to setup custom domain names with Heroku?

查看:159
本文介绍了如何使用Heroku设置自定义域名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试按照Heroku的文档为其添加自定义域名我的Ruby on Rails应用程序.在我的CLI中,我已经添加了域,并且在运行heroku域时可以看到该域:

I am attempting to follow the documentation from Heroku to add a custom domain name for my Ruby on Rails application. In my CLI I have added the domain and it is viewable when I run heroku domains:

域名指向我的地址,DNS目标指向我的Heroku App地址.

The Domain Name points to my address and the DNS Target points to my Heroku App address.

在我的域名注册机构(GoDaddy)中,我将CNAME设置为我的Heroku地址.该域已经传播了足够的时间,并且在我访问它时仅显示该域已被停放.

Inside my domain registrar, (GoDaddy), I set the CNAME to my Heroku address. The domain has propagated for enough time and it just displays that it is being parked when I access it.

我做错了什么?

推荐答案

我与Godaddy有一个非常相似的问题,除了我不仅要处理将www.something.com转发到我的herokuapp上,而且还要处理something.com转发到我的问题上.相同的应用程序(没有www).

I had a very similar problem with Godaddy except I was also dealing with not only forwarding www.something.com to my herokuapp but also the something.com forwarding to the same app (without the www).

这就是我建议你做的

在您拥有类似域名的域下检查您的heroku设置

Check in your heroku settings under domains you have something like this


   domain_name: www.something.com    DNS_Target: something.herokuapp.com
   domain_name: something.com        DNS_Target: something.herokuapp.com 

在Godaddy上,在域名详细信息">设置"下,确保您的转发看起来像这样

On Godaddy, under domain details > settings, make sure your forwarding looks like this


    Forwarding:   Domain: http://something.herokuapp.com/(forward only)

现在,在DNS区域文件下,确保您具有一个如下所示的CNAME(别名)记录... ps.如果您看不到记录,则此部分在CNAME部分的底部(第1页,共2页)分页

Now under the DNS Zone file make sure you have a CNAME (Alias) record that looks like this below ... ps. this section has a (page 1 of 2) pagination at the bottom of the CNAME section if you don't see your record it could be on the next page


  host: www   points_to: something.herokuapp.com   ttl: 600 seconds  

现在重要的部分在您的A(主机)记录下,您需要更改 @ 主机以指向此确切的IP地址...

now the important part is under your A (Host) records you need to change the @ host to point to a this exact ip address ...


  host: @   points_to:   174.129.25.170   ttl: 600 seconds

当我处理此问题时,这个SO问题/答案帮助我做到了^,这解决了我的问题.尤其是指向该IP地址的@ points _

when i dealt with this problem, this SO question/answers helped me do that ^ which solved my issues. Especially the @ points_to that ip address

这篇关于如何使用Heroku设置自定义域名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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