Can I enable SSL in Sinatra with Thin?

后端 未结 3 2056
情话喂你
情话喂你 2021-01-02 13:57

I\'m looking for a simple way to enable SSL in a standalone Sinatra application running via Thin without having to pass the --ssl, --ssl-key-file a

3条回答
  •  醉梦人生
    2021-01-02 14:13

    I'm running Sinatra and Thin (on Heroku) with SSL using the Rack::SslEnforcer, doing this:

    if production?
        require 'rack/ssl-enforcer'
        use Rack::SslEnforcer
    end
    

    This should be before you enable :sessions in your file.

提交回复
热议问题