Heroku HTTP Origin Header didn't match request.base_url

January 04, 2019

If you’re seeing a Heroku error such as Cloudflare + Heroku "HTTP Origin header (https://example.com) didn't match request.base_url (http://example.com), it’s due to the mix of https and http.

I’m using Cloudflare along with Heroku, so I went to the Crypto tab and set “Flexible” to “Full (Strict)”, which fixed the issue. Depending on your setup, your solution may vary.

I'm sharing everything I learn while building a software company. Join my newsletter to receive advice and opportunities that I never post publicly. Or learn more about me?