title: Ruby on rails: force_ssl not redirecting from http to https when using thin start --ssl
body: <p>I have been trying to configure my rails project to use SSL (as application wide) with thin (by adding thin gem and placing <code>config.force_ssl = true</code> to <code>application.rb</code>) but as a result, I have an annoying problem.</p>
  
  <p>When I start my rails server using <code>rails s</code> and try to access <code>http://localhost:3000</code> it redirects to <code>https://localhost:3000</code> which is correct, however it will complain about missing SSL certification.. </p>
  
  <blockquote>
    <p>SSL connection error </p>
    
    <p>Unable to make a secure connection to the server. This may be a
    problem with the server, or it may be requiring a client
    authentication certificate that you don't have.</p>
  </blockquote>
  
  <p>On the other hand, If I start my application using <code>thin start --ssl</code> and try to access <code>http://localhost:3000</code> it doesn't redirect to <code>https://localhost:3000</code> and complains about this:</p>
  
  <blockquote>
    <p>No data received </p>
    
    <p>Unable to load the webpage because the server sent no data.</p>
  </blockquote>
  
  <p>but by accessing <code>https://localhost:3000</code> it just shows certificate warning but it all works after agreeing to continue.</p>
  
  <p><strong>So my question is</strong>, How can I make http to https redirection work when using SSL with thin in (development mode)?</p>
  
  <p>Perfect answer would contain possibility to start server normally by using <code>rails s</code> while SSL would be enabled application wide and accessing http redirects to https and all works! :)</p>
  
  <p>Thanks in advance, have been searching for hours but cant find an answer.</p>