Ruby on rails: force_ssl not redirecting from http to https when using thin start --ssl

你。 提交于 2019-12-01 23:15:50

You should install your own openssl signed certificate. You can find more information on this page

Your PC as (localhost) can self sign SSL certificate and your browser can accept it, but i think that browser will not automatically accept certificate with security on that layer. Maybe to try to add your localhost certificate to the browser ?

Shree

Verify config/environments/development.rb has the following line

config.force_ssl = true

Refer the post thin with ssl support and ruby debug and the responses(from nathan and shree) that has more information on this subject:

Use ngrok (https://ngrok.com/). It's free. Installation is easy.

Just start up your server, then in another terminal window run

ngrok http 3000

ngrok will give you an address that loops back to your dev machine - something like http://randomstringhere.ngrok.io

Put that in your browser and you'll see it redirect to https://randomstringhere.ngrok.io, still routing to your server on port 3000

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!