Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails Heroku SSL https:// redirect

I have a Rails 5 app with Heroku's SSL added. www.example.com and example.com works fine but when I preface my site with "https://" It doesn't work, but "http://" works.

I'm using Namecheap.com for my DNS. How do I go about getting "https://example.com" to direct to my heroku app?

like image 217
An Le Avatar asked Dec 18 '22 12:12

An Le


1 Answers

What you need to do is :

You need to have SSL Endpoint addon added to your heroku app

It will provide a EndPoint URL for your heroku app.

https://devcenter.heroku.com/articles/ssl-endpoint

And you need to add SSL cert configured brought from third party vendors.

Then you can add CNAME record with with given EndPoint URL from SSL Endpoint plugin.

Make sure to add this in config/environments/production.rb

config.force_ssl = true

It will work then.

like image 82
Ranzit Avatar answered Dec 27 '22 04:12

Ranzit