Rails - 配置DNS以Heroku(123-reg) [英] Rails - Configuring DNS to host with Heroku (123-reg)

查看:504
本文介绍了Rails - 配置DNS以Heroku(123-reg)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在试图找出如何在 heroku 上发布我的应用程序。我的DNS是123-reg。 123-reg不支持英雄部署,反之亦然。

I am trying to figure out how to publish my app on heroku. My DNS is with 123-reg. 123-reg does not provide any support for heroku deployment and vice versa.

我以前曾问过这个问题(投票和嘲笑评论)
<一个href =https://stackoverflow.com/questions/39926476/rails-heroku-configuring-123-reg-domain-for-heroku> Rails,Heroku - 配置123-reg域为英雄

I have previously asked this question (voted down and mocked in the comments) Rails, Heroku - configuring 123-reg domain for heroku

我再次要求,希望能够找到一些关于如何使这项工作有实质性的帮助。

I'm asking again in the hope of finding some substantive help on how to get this working.

目前,当我尝试使用我的自定义域名渲染页面时,我收到一条错误,说:

Currently, when I try to render the page using my custom domain name, I get an error that says:

此网站无法访问
www.mydomainname.com 的服务器DNS地址找不到。
尝试运行网络诊断。

This site can’t be reached www.mydomainname.com ’s server DNS address could not be found. Try running Network Diagnostics.

DNS_PROBE_FINISHED_NXDOMAIN

当我在终端中尝试以下操作时,我得到以下回应:

When I try the following in the terminal, I get the responses noted below:

host www.mycustomdomainname.com 

找不到主机www.mycustomdomainname.com:3(NXDOMAIN )

Host www.mycustomdomainname.com not found: 3(NXDOMAIN)

host https://www.mycustomdomainname.com

主持 https://www.mycustomdomainname.com 未找到:2(SERVFAIL)

Host https://www.mycustomdomainname.com not found: 2(SERVFAIL)

dig www.mycustomdomainname.com cname +short

myherokualias.herokudns.com

英雄域返回英文别名有和没有www前缀。

heroku domains returns the heroku alias both with and without the www prefix.

在我的DNS中,我有一个CNAME记录:

In my DNS, I have a CNAME record with:

DNS入口类型优先TTL目的地/目标
www CNAME mycustomdomainname.herokudns.com。

DNS ENTRY TYPE PRIORITY TTL DESTINATION/TARGET www CNAME mycustomdomainname.herokudns.com.

除此之外,我有电子邮件帐户的MX和TXT记录。

Apart from that I have MX and TXT records for my email account.

任何人都可以看到我需要做什么才能使用我的自定义域名来渲染页面?

Can anyone see what I need to do to get the page to render using my custom domain name?

当我尝试:

curl -vI https://www.mycustomdomainname.com
*将网址重新建立: https://www.mycustomdomainname.com/
*无法解析主机:www。 mycustomdomainname.com
*关闭连接0
curl:(6)无法解析主机:www.mycustomdomainname.com

curl -vI https://www.mycustomdomainname.com * Rebuilt URL to: https://www.mycustomdomainname.com/ * Could not resolve host: www.mycustomdomainname.com * Closing connection 0 curl: (6) Could not resolve host: www.mycustomdomainname.com

我迷失了事情试图让这个工作

I'm lost for things to try to get this working

HEROKU设置

我可以看到检查我的英雄生产检查,我有以下问题:

I can see from inspecting my heroku Production Check, that I have the following issues:

FAILED DNS configuration
Your DNS is not configured correctly. Your domain "mycustomdomain.com"'s ALIAS or ANAME record should point to ancient-water-74339.herokuapp.com.

然而,它也说:

PASSED Heroku SSL

Heroku SSL指令说:

The Heroku SSL instructions say:

Change your DNS for all domains on your app
Verify your DNS settings by running dig www.yourdomainname.com cname +short. If it returns www.yourdomainname.com.herokudns.com then you have set it up correctly. If you are using an ALIAS or ANAME record, you can verify that based on the DNS provider. For instance, DNSimple will return a TXT record showing how your domain’s ALIAS is set-up.
You should note that it may take up to 24 hours before your DNS is fully propagated globally.

对我来说,这意味着我应该将引用替换为herokuapp,并引用'herokudns'。此外,我正在阅读这些说明,要求我用'mycustomdomainname'代替'古水74339'。

To me, that means I'm supposed to replace the reference to 'herokuapp' with a reference to 'herokudns'. Also, I am reading these instructions to require that I replace 'ancient-water-74339' with a 'mycustomdomainname'.

我已经完成了(按照我的说明),以便我的DNS上的CNAME现在指向mycustomdomainname'.herokudns.com。

I have done this (as I understand the instructions) so that the CNAME on my DNS now points to 'mycustomdomainname'.herokudns.com.

英雄生产检查表明这是不正确的。我应该有2个CNAME记录(一个使用heroku alias.herokuapp),另一个使用'mycustomdomainname'.heroku dns

The heroku production check says that this is incorrect. Am I supposed to have 2 CNAME records (one using the heroku alias.herokuapp) and another using 'mycustomdomainname'.herokudns?

我试图使用LetsEncrypt_plugin gem的rails。我无法验证该配置是否有错误,因为该gem不支持heroku。

I tried to use the LetsEncrypt_plugin gem for rails. I cannot verify whether there is an error in that config because that gem does not provide support for heroku.

任何人都可以看到我应该做什么来摆脱这个配置地狱?

Can anyone see what I'm supposed to do to get out of this configuration hell?

使用SSL的DNS的英文生产检查说明指示了SSL端点的设置。 SSL端点指令说它们仅适用于旧客户端(我不知道旧版客户端是什么),但该页面建议使用Heroku SSL。那些说明在应用程序名称的末尾使用'herokudns.com'。

The heroku production check instructions for DNS with SSL give instructions to provision an SSL Endpoint. The SSL Endpoint instructions say they are only for legacy clients (I don't know what a legacy client is), but that page suggests using the Heroku SSL instead. Those instructions say to use 'herokudns.com' on the end of the app name.

我似乎无法将这些说明的任何组合用于工作。 p>

I can't seem to get any combination of these instructions to work.

推荐答案

清单


    您的DNS提供商确保您的CNAME记录已正确设置:
  1. On your DNS provider make sure your CNAME record is properly set:

Host: *
Points To: yourapp.herokussl.com

如何在123-reg中添加CNAME记录

在Heroku上转到资源,确保你有 SSL附加组件已安装。

On Heroku go to 'Resources' and make sure you have the SSL add-on installed.

开Heroku转到设置/域名和证书,并确保您的自定义域名正确设置:

On Heroku go to 'Settings/Domains and certificates' and make sure you have your custom domains correctly set:

Domain Name: *.yourdomain.com
DNS Target: yourapp.herokussl.com

请注意herokuapp上的url .com和herokussl.com可能有所不同。如果您使用SSL证书,则必须使用SSL证书。

Please note the url on herokuapp.com and herokussl.com may differ. If you are using an SSL certificate you'll have to use the latter.

Gotchas


  • 使用英雄工具箱确保您的SSL证书仍然可信

  • Using the heroku toolbelt make sure your SSL certificate is still trusted

heroku certs:info --app yourapp


  • 您的注册商和您的DNS提供商可能会有所不同,这可能会导致您在不正确的地方编辑您的CNAME记录。

  • Your registrar and your DNS provider may differ, this may lead you to be editing your CNAME records on the incorrect place.

    为确保您在正确的位置在您的域上执行 whois

    To make sure you are at the right spot perform a whois on your domain:

    whois yourdomain.com | grep 'Name Server'
    

    如果您的域名实际上指向123-reg,则输出应为:

    If your domain is actually pointing to 123-reg, the output should be:

    Name Server: ns1-123-reg.co.uk
    Name Server: ns2-123-reg.co.uk
    

    如果输出是别的,那么你可能应该在其他地方设置你的CNAME记录。 / p>


  • If the output is something else, then you probably should be setting your CNAME records elsewhere.

    希望这有助于< 3

    Hope this helps <3

    这篇关于Rails - 配置DNS以Heroku(123-reg)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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