Heroku 自定义域不起作用 [英] Heroku Custom Domain Not Working

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

问题描述

将 Heroku 应用程序与自定义域连接的正确方法是什么?

What is the correct way to connect a Heroku app with a custom domain?

我过去是这样做的:

  1. 将 Godaddy 的 DNS 指向 heroku 提供的目标(例如:https://peaceful-escarpment-22825.herokuapp.com)

在域上开启域转发

在设置中将域添加到 Heroku

Add domain to Heroku in the settings

出于某种原因,我现在从 Heroku 提供的目标是这样的:mycustomdomain.com.herokudns.com.当我将该 DNS 添加到 GoDaddy 时,我得到一个 There's nothing, yet.页.

For some reason now my provided target from Heroku is like this: mycustomdomain.com.herokudns.com. When I add that DNS to GoDaddy I get a There's nothing here, yet. page.

我哪里出错了?谢谢!

推荐答案

我一直跳过这一步,因为自定义域已经出现在我的 Heroku 应用程序中.运行这个,它开始工作.

I kept skipping this step because the custom domain already showed up in my Heroku app. Ran this and it started working.

Heroku domains:add www.yourwebsite.com --app <app name>

奖励:希望每个页面都是安全的 SSL?使用这个很棒的 NPM 包 https://www.npmjs.com/package/force-ssl-heroku

Bonus: Want every page to be secure SSL? Use this awesome NPM package https://www.npmjs.com/package/force-ssl-heroku

2021 年更新:如果您收到 sni_endpoint 错误,请参阅此处:Heroku 自定义域:sni_endpoint?

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

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