I have deployed my java web application on elasticbeanstalk on AWS. I have bought domain from Godaddy and ssl certificate is generated from AWS using Certification manager.
Certificate is added to load balancer.
When I add https:// in url, it works fine.
Now, I want to redirect all traffic from http to https for web application. I have tried implementing below solutions found on google and numerous forums.
- Added Web distribution from Cloud front.
- Added rewrite rules in elasticbeanstalk.conf file under /etc/httpd/conf.d/
RewriteEngine On RewriteCond %{HTTP:X-Forwarded-Proto} =http RewriteRule . https://%{HTTP:Host}%{REQUEST_URI} [L,R=301]
May I know how i can achieve this ?