简体   繁体   中英

Redirect Loop on Heroku with Rails 4 App, but not on local machine

App running Ruby 2.2.2, Rails 4.2.1

When I run my app locally everything is fine. It was running fine on heroku until I made some updates. Now all I get in a browser is "Err too many redirects" from Chrome, or "Too many redirects..." in Safari. Even after I rolled back the version on heroku and reset the database I am still getting this. I have wiped out the cookies and cache on both browsers too. Still the error.

I get a bunch of these one after the other in the heroku log:

2015-06-14T15:09:23.160000+00:00 heroku[router]: at=info method=GET path="/" host=www.domain.com request_id=28455761-bc94-4a27-852f-249f5409a4f2 fwd="50.152.172.74,199.27.128.248" dyno=web.1 connect=1ms service=1ms status=301 bytes=157

Followed by one of these:

2015-06-14T16:11:18.084247+00:00 heroku[router]: at=info method=POST path="/payola/events" host=www.domain.com request_id=2ab49dd7-0392-4261-ae1e-1279998e37e1 fwd="54.241.34.107,199.27.133.164" dyno=web.1 connect=0ms service=1ms status=301 bytes=170

And then this before it shuts down: 2015-06-14T16:39:40.305372+00:00 heroku[router]: at=info method=GET path="/" host=www.domain.com request_id=a54f6089-ca85-428f-ac01-0c02421a83da fwd="50.152.172.74,199.27.128.73" dyno=web.1 connect=1ms service=1ms status=301 bytes=157

2015-06-14T16:39:40.498317+00:00 heroku[router]: at=info method=GET path="/" host=www.domain.com request_id=1f0aa9d4-7ae1-4141-ab32-7103aa0c1ef5 fwd="50.152.172.74,199.27.128.73" dyno=web.1 connect=0ms service=1ms status=301 bytes=157

2015-06-14T16:51:40.945338+00:00 heroku[router]: at=info method=GET path="/robots.txt" host=www.domain.com request_id=6a37a7d4-3277-4f55-9321-bdab79a744ff fwd="68.180.228.91,108.162.246.80" dyno=web.1 connect=3ms service=4ms status=301 bytes=167

2015-06-14T16:51:41.287899+00:00 heroku[router]: at=info method=GET path="/pricing" host=www.domain.com request_id=433b98e3-d445-47f3-b9b3-212dff1dfb57 fwd="68.180.228.91,108.162.246.226" dyno=web.1 connect=2ms service=8ms status=301 bytes=164

2015-06-14T16:56:30.228037+00:00 heroku[router]: at=info method=POST path="/payola/events" host=www.domain.com request_id=9de5611a-4cc4-474e-a4cf-26dfd1de31b3 fwd="54.241.34.107,199.27.133.114" dyno=web.1 connect=6ms service=2ms status=301 bytes=170

2015-06-14T17:58:38.217217+00:00 heroku[router]: at=info method=POST path="/payola/events" host=www.domain.com request_id=48a6417f-69f4-4ed2-b468-bf0edfae0c90 fwd="54.241.34.107,199.27.133.189" dyno=web.1 connect=0ms service=1ms status=301 bytes=170

2015-06-14T18:32:20.867295+00:00 heroku[router]: at=info method=POST path="/payola/events" host=www.domain.com request_id=276fc89e-3e07-441b-ad00-f2b60c77e540 fwd="54.241.34.107,199.27.133.189" dyno=web.1 connect=0ms service=1ms status=301 bytes=170

2015-06-14T19:05:57.170756+00:00 heroku[router]: at=info method=GET path="/robots.txt" host=www.domain.com request_id=22174ed2-db0a-45bb-b9d7-0a6f2ba2ac8c fwd="208.115.113.85,108.162.246.205" dyno=web.1 connect=4ms service=15ms status=301 bytes=167

2015-06-14T19:44:10.474487+00:00 heroku[router]: at=info method=POST path="/payola/events" host=www.domain.com request_id=bb575e60-1017-41c7-869e-31c0f3ec2528 fwd="54.241.34.107,199.27.133.164" dyno=web.1 connect=1ms service=2ms status=301 bytes=170

2015-06-14T20:46:06.583978+00:00 heroku[router]: at=info method=POST path="/payola/events" host=www.domain.com request_id=c348fef6-6ada-4825-a9ca-3631840d8e51 fwd="54.241.31.99,199.27.133.53" dyno=web.1 connect=8ms service=5ms status=301 bytes=170

Does anyone know what is causing this?

I discovered the answer. I am on Cloudflare's network. Turns out that if on their "Crypto" panel, if the SSL is set to "flexible" then you will get the redirect loop error. Had to set it to "Full".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM