简体   繁体   English

我应该如何在Ruby on Rails中使用https

[英]How should I use https in Ruby on Rails

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. 我正在用Rails(2.3.4)开发应用程序,其中有些部分需要在安全协议上运行,例如,登录表单,信用卡表单等。

  1. How can I do just these pages be https, and all other pages remain http? 我该如何仅将这些页面设为https,并将所有其他页面保持为http?
  2. How can I test ssl in development environment? 如何在开发环境中测试SSL?

Configure apache to use SSL for the paths that require it (ie, '/login' etc.). 配置apache以将SSL用于需要它的路径(即'/ login'等)。

You'll also need to configure your routes to use https: 您还需要将路由配置为使用https:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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