
在类似 https://myapp.com/controller/action 的controler中使用redirect_to跳转到当前app某个controller时,默认总是跳转到: http://myapp.com,解决办法是在app/controllers/application.rb中重写default_url_options方法:
def default_url_options(options)
{ :protocol => 'https://' }
end
或者在apache的vhosts配置文件中修改如下设置:
RequestHeader set X_FORWARDED_PROTO "https"
最新评论
16 小时 13 分钟 前
6 周 19 小时 前
6 周 6 天 前
7 周 4 天 前
8 周 3 天 前
8 周 4 天 前
8 周 4 天 前
8 周 4 天 前
8 周 4 天 前
9 周 1 天 前