这可能是一个二合一的问题。
我有一个用于家庭/爱好使用的Rails应用程序,托管在Raspberry Pi上,我想知道是否可以为它创建本地SSL证书并设置Rails使用它?
如果是,我如何设置我的Rails / Puma / Foreman / Ubuntu应用程序?现在,我使用Procfile运行应用程序,使用Procfile:
web: bundle exec puma -t 8:8 -p 3000
worker: bundle exec sidekiq
clock: bundle exec clockwork config/clock.rb
答案 0 :(得分:7)
https://gist.github.com/tadast/9932075
我的procfile包含一个如下所示的条目:
服务器:rails服务器puma -b'sssl://0.0.0.0:3000?key = server.key& cert = server.crt'
这似乎对我有用。我也设置了
config.force_ssl = true
在config / application.rb 中
我从所有这些地方收集了有关它的信息:
http://www.railway.at/2013/02/12/using-ssl-in-your-local-rails-environment/
http://www.panozzaj.com/blog/2013/08/12/how-to-set-up-local-https-development/
http://www.eq8.eu/blogs/14-config-force_ssl-is-different-than-controller-force_ssl