Disabling SSL for a Heroku App

后端 未结 2 1254
情歌与酒
情歌与酒 2021-01-02 04:17

I recently changed the domain for a Rails app I have running on Heroku. I redirected the original to the new one, and for the last couple of months have been running SSL on

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-02 04:44

    In addition to what Jan said, here is what I did to do the trick.

    In application_controller.rb :

    before_filter :expire_hsts
    
    [...]
    private
      def expire_hsts
        response.headers["Strict-Transport-Security"] = 'max-age=0'
      end
    

    In production.rb

    config.force_ssl = false
    

    Clear the cache of your web browser and that's it !

提交回复
热议问题