用heroku配置namecheap域 [英] configuring namecheap domains with heroku
问题描述
我在heroku(付费dyno)上有一个应用程序:
我已购买域名:
www.mysite.com
阅读完多个指南后,我无法弄清楚如何执行以下操作:
总体目标是建立一个像 api.mysite.com
谢谢。注意:请不要简单地链接到来自heroku和namecheap的文档。我已经阅读了所有内容,并且它们已经过时/不具体。 我刚刚做了类似的事情最近,我认为这是你需要的。就我而言,我需要打开SSL ACM(自动证书管理)对于我现有的heroku应用程序。
首先,您需要启用自动证书管理以从heroku获得SSL证书。
-
检查ACM是否打开
$ heroku certs:auto -a [您的应用名称]
===自动证书管理在[您的应用名称]上被禁用
注意:如果您没有安装heroku-toolbelt,请忽略此步骤。这只是一张支票。
-
转至heroku仪表板的设置
-
- 点击'配置SSL'按钮
- 选择ACM并点击继续
- 如果api.mysite.com不是已经在那了。
- 记下类似于api.mysite.com.herokudns.com的'DNS目标'。
$ heroku certs:auto -a [您的应用程序名称]
===自动证书管理在[您的应用名称]
其次,您需要登录到您的namecheap dns zonefile页面并添加一个CNAME。
-
将CNAME更改为'api'记录以指向api.mysite.com.herokudns.com(或其他任何内容上面的DNS目标)
类型名称值
A @ 10.10.10.10<<<您的www ip
CNAME api api.mysite.com.herokudns.com<<<你需要这个。
-
等待10分钟
浏览至api.mysite.com
I have a app on heroku(paid dyno):
I have purchased a domain:
www.mysite.com
After reading multiple guides I can't figure out how to do the following:
- point domain to my heroku app(with SSL)
- configure a subdomain like api.mysite.com
The overall goal is to have a domain like api.mysite.com
Thanks. NOTE: Please do not simply link to documents from heroku and namecheap. I have read them all, and they are out of date/unspecific.
I have just done something similar recently and I think it's what you need. In my case, I need to turn on SSL ACM (Automatic Certificate Management) for my existing heroku app.
First, you need to turn on Automatic Certificate Management to get the SSL certificate from heroku.
Check if ACM is on
$ heroku certs:auto -a [your app name] === Automatic Certificate Management is disabled on [your app name] Note: if you don't have heroku-toolbelt installed, just ignore this step. It's just a check.
Go to heroku dashboard's Settings
- Click on 'Configure SSL' button
- Choose ACM and click continue
- Click 'Add domain' button if api.mysite.com is not already there.
- Take note of the 'DNS Target' which is something like api.mysite.com.herokudns.com
Check certificate status again
$ heroku certs:auto -a [your app name] === Automatic Certificate Management is enabled on [your app name]
Second, you need to login to your namecheap dns zonefile page and add a CNAME.
Change CNAME to 'api' record to point to api.mysite.com.herokudns.com (or whatever is there in the DNS Target above)
TYPE NAME VALUE A @ 10.10.10.10 <<< your www ip CNAME api api.mysite.com.herokudns.com <<< you need this one.
Wait 10 mins
- Browse to api.mysite.com
这篇关于用heroku配置namecheap域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!