我应该如何在Ruby on Rails中使用https [英] How should I use https in Ruby on Rails

查看:114
本文介绍了我应该如何在Ruby on Rails中使用https的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发Rails(2.3.4)中的应用程序,并且有些部分需要通过安全协议运行,例如登录表单,信用卡表单等。

I'm developing an application in Rails (2.3.4) and there are some parts that need to run over a secure protocol, for example, the login form, the credit card form, etc.


  1. 如何才能将这些页面设为https,所有其他页面保持为http?

  2. 如何测试ssl in开发环境?


推荐答案

配置apache以将SSL用于需要它的路径(即, '/ login'等。)。

Configure apache to use SSL for the paths that require it (ie, '/login' etc.).

您还需要配置路线以使用https:

You'll also need to configure your routes to use https:

map.resources:login,:requirements => {:protocol => 'https'}

这篇关于我应该如何在Ruby on Rails中使用https的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆