AndrewLeonardi AndrewLeonardi - 2 years ago 140
Node.js Question

Heroku Naked SSL Custom Domain

I'm trying to find a current, up to date answer for setting up naked domain with Godaddy and Heroku SSL. My goal is for all pages to land on a secure page at https://www.example.com

https://www.example.com
does go to a secure page.

example.com
goes to an insecure page.

https://example.com
does not work.

My current set up is as follows:

In heroku settings:

Domain Name | DNS Target

example.com | example.com.herokudns.com

www.example.com | www.my-domain.herokudns.com

Go Daddy Settings:

CNAME | www | www.example.com.herokudns.com

Forwarding settings:

Forward to: https:// | www.example.com

Answer Source

Solved it.

Best way to get SSL set up is to use this package which automatically makes every page on your app SSL. Fantastic package. https://www.npmjs.com/package/force-ssl-heroku

Getting the naked domain set up with Godaddy easily: Set forwarding to your domain: https://www.my-domain.com. This will redirect non www to the correct place. :)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download