Created
May 28, 2013 07:06
-
-
Save basti/5660974 to your computer and use it in GitHub Desktop.
Force SSL for some parts of an app with ability to turn it on/off on a server level (ENV var)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ENV['ENABLE_HTTPS'] == "yes" | |
config.middleware.use Rack::SslEnforcer, :only => %r{^/secure_pages}, :ignore => %r{^/assets}, :strict => true | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add Rack SSL Enforcer | |
gem "rack-ssl-enforcer", "~> 0.2.5", :require => 'rack/ssl-enforcer' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment