Heroku SSL with Route53

ぐ巨炮叔叔 提交于 2020-01-01 10:02:09

问题


My SSL certificate is all set up and ready to go on Heroku. I followed the instructions here https://devcenter.heroku.com/articles/route-53 to correctly redirect requests (e.g. example.com to www.example.com) using AWS S3. HTTPS works great when requestiong https://www.example.com; however, if I attempt to request https://example.com, the page cannot be found. Any thoughts?


回答1:


Using Route 53, you want to create the following DNS records:

  • www.example.com CNAME your_app.herokuapp.com
  • example.com ALIAS your_app.herokuapp.com

Your www.example.com hostname should be a CNAME record that delegates to your Heroku App hostname. Any other regular hostnames should be CNAMEs.

The example.com "Apex" or "naked domain" record must return an A record and cannot be a CNAME. Route53 implements the ALIAS record type, which looks up the values for your_app.herokuapp.com and returns a set of current A records to match.




回答2:


I've just been through this myself. The easiest and cheapest way to do it is to let Heroku (minimum 7 USD box) manage the SSL (ACM).

Add a custom domain there and enable SSL and you will be presented with a DNS target like: www.yourcustomdomain.com.herokudns.com. In Route53 add a CNAME record for your www.yourcustomdomain.com with the target into www.yourcustomdomain.com.herokudns.com.

Wait to refresh the DNS internationally.

I would assume the S3 bucket for directing the naked domain into the www.domain was done previous to the above mentioned.



来源:https://stackoverflow.com/questions/21295614/heroku-ssl-with-route53

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