title: Rails Application forcing ssl on all calls on Heroku
body: <p>I have an application which has a controller with actions which are forced to https and one exception using the following code: </p>
  
  <pre><code>force_ssl except: :show, if: :ssl_configured?
  
  def ssl_configured?
      Rails.logger.debug "ssl configured"
      ENV["ENABLE_HTTPS"] == "yes"
  end
  </code></pre>
  
  <p>Within one of the views I then have the url defined to access the http link as: </p>
  
  <pre><code>place_url(place.id, protocol: 'http')
  </code></pre>
  
  <p>When I run this on my local server (using an NGINX/WEBrick) all actions are redirected to HTTPS except for the show action which is remains unsecured. </p>
  
  <p>However when I deploy to heroku all actions redirect to a secure connection even though the link to the place show action is shown as http. </p>
  
  <p>I have not done any configuration on Heroku (other than setting the environment variable) so the app is running on the WEBrick server.</p>
  
  <p>How can I establish why the exception is being ignored on Heroku? Would I be better starting by configuring a unicorn server as advised in the <a href="https://devcenter.heroku.com/articles/getting-started-with-rails4#webserver">Heroku docs</a>? </p>