2

Rails 3.1.3

With force_ssl in place I get this redirect over and over and it never ends. I am going to the https url so I'm not sure why else it would complain. Ideas?

Started GET "/app/admin/calendar" for 69.64.227.254 at 2012-02-13 19:52:44 +0000
  Processing by Admin::CalendarsController#show as HTML
  User Load (1.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = 21 ORDER BY lower(first) ASC LIMIT 1
  Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = 23 AND (accounts.deleted_at IS NULL) LIMIT 1
Redirected to https://www.mydomain.net/app/admin/calendar
Completed 301 Moved Permanently in 4ms
99miles
  • 10,942
  • 18
  • 78
  • 123

2 Answers2

7

Answered here: Why am I getting infinite redirect loop with force_ssl in my Rails app?

Spoiler: add this to your nginx config file:

proxy_set_header X-Forwarded-Proto $scheme;
Community
  • 1
  • 1
John Scipione
  • 2,360
  • 4
  • 25
  • 28
1

If you are using config.force_ssl = true and end up in an infinite loop, try this:

In your nginx config change:

listen 443 default ssl;

to:

listen 443;
ssl on;

Credits to pjammer: Nginx configuration leads to endless redirect loop

Community
  • 1
  • 1
sandstrom
  • 14,554
  • 7
  • 65
  • 62
  • This did not work for me, see my answer below which links to another Stack Overflow question that did solve the problem. – John Scipione Mar 20 '13 at 18:24