I try to use my site on both http and https using the request object, as in the documentation: http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html
I tried many configurations and many combinations, right now this is what I have in my /staging.rb environment
config.action_controller.asset_host = Proc.new { |source, request=nil| if request && request.ssl? "https://staging.foobar.it" else "http://assets#{ ( source.length % 4 ) + 1 }.staging.foobar.it" end }
with this solution, it looks like the request object is always set to zero.
I am using Ruby 1.9.3 and rails 3.2.12, with nginx as the reverse proxy and unicorn as the application server and precompiling my assets
Has anyone been able to configure this and link the https link to the corresponding https asset server? What am I doing wrong?
source share