title: Http to Https AWS Elasticbeanstalk
body: <p>I am using AWS Elasticbeanstalk for my Spring MVC web application. I want to redirect all the request to https. I tried following this <a href="https://stackoverflow.com/questions/14693852/how-to-force-https-on-elastic-beanstalk/48548156#48548156">How to force https on elastic beanstalk?</a> but this didn't work for me. This code redirects to https but my app didn't work. It shows "This page isn’t working". Code for your reference </p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
    RewriteEngine on
    RewriteCond %{HTTP:X-Forwarded-Proto} =http
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    &lt;Proxy *&gt;
      Order Allow,Deny
      Allow from all
    &lt;/Proxy&gt;
    ProxyPass / http://localhost:8080/ retry=0
    ProxyPassReverse / http://localhost:8080/
    ProxyPreserveHost on
  
    ErrorLog /var/log/httpd/elasticbeanstalk-error_log
  &lt;/VirtualHost&gt;
  </code></pre>