How to configure bare domain name to work with Heroku SSL endpoint?

I recently added SSL functionality to my Rails application running on Heroku. I have successfully purchased and created a certificate for my domain and using CNAME in GoDaddy, the WWW subdomain of my application works correctly when a user views www.myappname.com

The page loads without any warning, and the certificate works as intended.

CNAME looks something like this: host: www points to: myappnamefoobar-1234.herokussl.com

However, when I just go to the bare domain name - myappname.com, a certificate error appears.

How to configure DNS settings in GoDaddy to do this?

https://devcenter.heroku.com/articles/avoiding-naked-domains-dns-arecords

Heroku docs on bare domains have a whole article, but I don’t see how this applies to GoDaddy's DNS Manager.

I know Heroku has some kind of SSL IP protocol which is paid, but is there any other way to do this?

+4
source share
3 answers

The trick is to use rewrite racks:

https://github.com/jtrupiano/rack-rewrite

It allows Rails to redirect from mydomainname.com to www.mydomainname.com, as Heroku does not allow naked domains.

You then use your DNS manager to point the website www.mydomain.com to the Heroku SSL endpoint (billed $ 20 per month).

+3
source

I do not believe that GoDaddy supports such functionality.

The best option is to use something like the DNSimple ALIAS record type , which provides root domain support for the CNAME record.

You can then configure your entries (assuming you use an SSL endpoint for SSL).

| type | name | target | | ALIAS | | tokyo-123.herokussl.com | | CNAME | www | tokyo-123.herokussl.com | 

Although there are other DNS providers that provide similar ALIAS record functions, this is not something in the DNS specification. That is why we have yet to provide full documentation on the use of such records. However, we strive to fix this in the near future, given the lack of clear guidelines for those who want root domain support.

Stay tuned for using AWS Route 53 as your Heroku DNS application . I believe that this will or will soon be possible for this on the R53 in the near future.

+1
source

If the purchased certificate has the common name "www.yourdomain.com" and you browse the site using any other URL, you will receive a certificate warning in your browser.

The warning informs you that the URL does not match the domain name.

One way around this problem is to buy a wildcard certificate. This allows *.yourdomain.com" . *.yourdomain.com"

0
source

Source: https://habr.com/ru/post/1415083/


All Articles