Ruby on rails 强制ssl导致无止境的重定向
轨道3.1.3 有了force_ssl,我一次又一次地得到这个重定向,它永远不会结束。我要去https的网址,所以我不知道为什么它会抱怨。想法Ruby on rails 强制ssl导致无止境的重定向,ruby-on-rails,ruby-on-rails-3,ssl,Ruby On Rails,Ruby On Rails 3,Ssl,轨道3.1.3 有了force_ssl,我一次又一次地得到这个重定向,它永远不会结束。我要去https的网址,所以我不知道为什么它会抱怨。想法 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
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
如果您使用的是
config.force\u ssl=true
并最终进入无限循环,请尝试以下操作:
在nginx配置更改中:
listen 443 default ssl;
致:
pjammer的信用证:回答如下:
扰流板:将其添加到nginx配置文件:
proxy_set_header X-Forwarded-Proto $scheme;
您运行应用程序所使用的web服务器是什么?请发布您的nginx配置。感谢各位,通过在nginx中完成所有工作并从rails中删除force_ssl,我现在似乎可以正常工作。这对我不起作用,请参阅下面我的答案,其中链接到另一个解决问题的堆栈溢出问题。
proxy_set_header X-Forwarded-Proto $scheme;