具有自定义域的Heroku中的SSL [英] SSL in Heroku with a custom domain

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

问题描述

我正在使用 PointHQ 作为DNS,并将我的域托管在Heroku上.默认情况下,似乎Heroku支持https(例如 https://yodel-site.herokuapp.com ),但不是当您使用 https://yodel.co 进入我的网站时-尽管它仅适用于http ://.

I'm using PointHQ as a DNS and hosting my domain on Heroku. On default, it looks like Heroku supports https (eg. https://yodel-site.herokuapp.com), but not when you go to my site with https://yodel.co - although it works with just http://.

要使SSL(https)在Heroku中的自定义域上起作用,我需要做什么?是否需要在DNS( PointHQ )中进行配置,还是需要为

What do I need to do in order for SSL (https) to work on my custom domain in Heroku? Is it something to configure in my DNS (PointHQ), or do I need to pay heroku for the addon?

这是我的Heroku自定义域部分的样子:

Here's what my Heroku custom domains section looks like:

推荐答案

最简单,最便宜的方法是从Free升级到Hobby Dynos,一个小型应用程序每月的费用最高为7美元,实际上可能很多减少,因为价格按比例分配给您的Dyno每月运行时间.( https://www.heroku.com /定价) 这比获得SSL Heroku附加组件的每月20美元便宜得多.

The simplest and cheapest way is to upgrade from Free to Hobby Dynos, it will cost a maximum of 7$/month for a small app, and actually probably much less because the price is prorated to the time your Dyno will run per month.(https://www.heroku.com/pricing) This is much cheaper than the 20$/month to get the SSL Heroku add-on.

将计划从免费"升级到兴趣爱好"后,事情将变得非常简单:

Once you have upgraded your plan from Free to Hobby, things are pretty straightforward:

  • 在Heroku上转到您的应用,转到设置,向下滚动到域和证书,​​然后添加您的域:www.yourdomain.com
  • 这将自动为您提供DNS目标,例如www.yourdomain.com.herokudns.com
  • 在您的域名托管服务商中:
    • 使用此DNS目标添加CNAME记录,例如在Godaddy上,例如:类型:CNAME名称:www.值:www.yourdomain.com.herokudns.com
    • 将重定向操作从您的根域(yourdomain.com)添加到www.yourdomain.com
    • Go to your app on Heroku, go to settings, scroll down to domains and certificates, and add your domain: www.yourdomain.com
    • This will automatically give you a DNS target as such www.yourdomain.com.herokudns.com
    • In your Domain Host:
      • Add a CNAME record using this DNS target, for instance on Godaddy as such: Type: CNAME Name: www. Value: www.yourdomain.com.herokudns.com
      • Add a redirect action from your root domain (yourdomain.com) to www.yourdomain.com

      让DNS更改传播几个小时,您就一切准备就绪了!

      Allow a few hours for the DNS changes to propagate, and you're all set!

      这篇关于具有自定义域的Heroku中的SSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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