Objectives
- Run https://rapid.essbap.org through Cloudflare.
- This should map to https://ebcc-rrn.herokuapp.com (Rails app)
- However, I get "too many redirects" pages, e.g.
- Have done this successfully before on other Heroku apps, using steps below
- What am I missing?
What I did
- Purchased
essbap.org
through Godaddy. - Imported DNS to Cloudflare.
- Inserted Cloudflare name servers at Godaddy.
- Removed zone records from Godaddy.
Cloudflare:
- Inserted CNAME record
rapid
to point toebcc-rrn.herokuapp.com
- On Heroku: added custom domain
rapid.essbap.org
toebcc-rrn.herokuapp.com
Heroku:
heroku domains:add rapid.essbap.org
=== ebcc-rrn Heroku Domain
ebcc-rrn.herokuapp.com
=== ebcc-rrn Custom Domains
Domain Name DNS Target
---------------- ----------------------
rapid.essbap.org ebcc-rrn.herokuapp.com
$ host rapid.essbap.org
rapid.essbap.org has address 104.27.162.137
rapid.essbap.org has address 104.27.163.137
Cloudflare settings
JUST ADDED:
Running curl
When I run curl
against another Heroku custom domain app that I know works, it looks like:
$ curl -I some.custom_app.com
HTTP/1.1 301 Moved Permanently
Location: https://some.custom_app.com/
# since I'm using force_ssl on Rails, we expect to be directed to https://
$ curl -I https://some.custom_app.com/
HTTP/1.1 200 OK
Similar behaviour for ebcc-rrn.herokuapp.com
(the Herokuapp we want rapid.essbap.org
to be an alias for). A 301 then 200.
But when I run curl
against rapid.essbap.org
, I get:
$ curl -I rapid.essbap.org
HTTP/1.1 301 Moved Permanently
Location: https://rapid.essbap.org/
# since I'm using force_ssl on Rails, we expect to be directed to https://
$ curl -I https://rapid.essbap.org
HTTP/1.1 301 Moved Permanently
Location: https://rapid.essbap.org/
We get a 301 instead of a 200 in the second case. Am not sure why the 301 is being generated. Does not happen in dev or with ebcc-rrn.herokuapp.com
.
What am I missing?