Heroku SSL on root domain

后端 未结 6 1389
孤独总比滥情好
孤独总比滥情好 2020-12-02 05:26

I am trying to setup SSL for my heroku app. I am using the hostname based SSL add-on. The heroku documentation states the following:

Hostname based SSL will          


        
6条回答
  •  既然无缘
    2020-12-02 05:57

    On the Rails part, to make the redirection, it'd be more sane to make it occur on the router layer, like this (works on Rails 3+):

    Rails.application.routes.draw do
    
      match '/*splat' => redirect { |_, request| request.url.sub('//www.', '//') }, :constraints => { :subdomain => 'www' }
    
      # ...
    
    end
    

提交回复
热议问题