[英]Login with Facebook with authlogic and omniauth-facebook
[英]Omniauth-facebook login not working
以HTTPS模式运行本地服务器可能很多次,不仅仅适用于facebook api。
虽然,Rails仍然没有提供在SSL模式下运行rails服务器的简单方法 。 但有几种方法可以实现这一目标:
使用thin
服务器而不是puma / webrick rails默认值
thin
服务器允许您以最少的工作量以SSL模式运行应用程序:
编辑config/application.rb
并添加:
config.force_ssl = true
启动thin
服务器:
$ thin start --ssl
请参阅此处的完整信息: 如何在两分钟内为Rails开发环境启用SSL?
使用像ngrok
这样的http隧道工具
像ngrok这样的工具允许您轻松地创建从本地主机到Internet的隧道 - 它还为您创建http://
和https://
端点:
$ rails s -p 3000
$ ./ngrok http 3000
ngrok by @inconshreveable (Ctrl+C to quit)
Session Status online
Session Expires 7 hours, 59 minutes
Version 2.2.8
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding http://2608e936.ngrok.io -> localhost:3000
Forwarding https://2608e936.ngrok.io -> localhost:3000
复制生成的URL(如https://2608e936.ngrok.io
并使用它来访问本地服务器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.