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

前端 未结 5 1632
生来不讨喜
生来不讨喜 2021-01-21 03:49

I have been trying to configure my rails project to use SSL (as application wide) with thin (by adding thin gem and placing config.force_ssl = true to applica

5条回答
  •  旧巷少年郎
    2021-01-21 04:30

    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

提交回复
热议问题