Cloudflare is returning a 502 Bad Gateway but curl returns 301 Moved Permanently

Heroku has an automatically managed SSL cert with 2 domain names: and Both targets have been added as DNS records in Cloudflare. Both are set to Proxied.

SSL is set to Full, there are no edge, client, or origin server certificates set up on Cloudflare.

Always Use HTTPS is enabled.

Universal SSL is enabled.

I have verified that I do not have any Rules or Bulk Redirects set up for this domain.

Been banging my head against this for the better part of a week and a half. I reached out to Heroku since the error seemed to indicate that the issue was on the server-side, but what they’re telling me seems to imply that the issue is SSL related… but that shouldn’t be the case since I have an SSL cert established on Heroku, right?

That error page means that Cloudflare got a bad gateway error from your origin, in this case Heroku. If you pause Cloudflare on your site then do you still see a bad gateway error?

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.