Heroku Custom Domain Not Working

独自空忆成欢 提交于 2020-05-24 20:00:43

问题


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

This is how I did it in the past:

  1. Point Godaddy's DNS to heroku's provided target (example: https://peaceful-escarpment-22825.herokuapp.com)

  2. Turn on domain forwarding on the domain

  3. Add domain to Heroku in the settings

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.

Where am I going wrong? Thanks!


回答1:


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

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




回答2:


This worked for me, but I had to include --app <app name> at end of the command. Like this:

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

For the app name, it is the app name you used when creating the app in Heroku.




回答3:


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

This is the best way to do it as it needs to know which specific app to point to.



来源:https://stackoverflow.com/questions/42796355/heroku-custom-domain-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!