I just purchased a new domain in GoDaddy
lets call it example.com
. I want to connect this domain to my Heroku
app, so I went to the settings in Heroku
and under Domains
section I added the followings options for my domain:
www.example.com
example.com
Then, in GoDaddy
, under DNS management I created two CNAME
records
I used the DNS targets that I got from Heroku
for each of the records.
The wild card got the DNS target from example.com
and the www
got the DNS target from www.example.com
.
Now, I wanted to test this setup so I tried to use GET
request in Postman. I tried http://www.example.com
and got 200 and the response I was expecting. However,
when I tried http://example.com
(without the www
prefix) I didn't get any response but an error instead:
Error: write EPROTO 140275225778376:error:10000458:SSL routines:OPENSSL_internal:TLSV1_ALERT_UNRECOGNIZED_NAME:../../third_party/boringssl/src/ssl/tls_record.cc:594:SSL alert number 112
Is this setup that I mention is correct? If I want to support both of the domain with and without the www
prefix what is the correct way to set this up?