I have implemented AWS ELB for SSL. It's working fine with my domain. I want to redirect http to https. So I used the CloudFront for it. But after implementing the cloudfront, I didn't get success.
For implementing the Cloudfront, I am using the default SSL because there is no certificate in region=us-east-1
. I have updated the CNames in Route53.
For generating the certificate under ELB I have opted global.
Any suggestion?
I got the solution after 10 days after a lots of R&D.
Http to https redirection using CloudFront
Follow below steps:
Login into your aws console and search CloudFront
Go to CloudFront: Create Distribution(please select Web distribution)
- Under Origin Settings : Select the Origin Domain Name (you can assign the IP is instance/You can opt the ELB/You can select the S3 bucket)
- Under Default Cache Behavior Settings : Select Viewer Protocol Policy: Redirect HTTP to HTTPS
- Under Object Caching: opt customize (Remain default setting in Minimum TTL , Maximum TTL and Default TTL)
- Forward Cookies : All
- Query String Forwarding and Caching : All
- Distribution Settings :
Select Price Class: (Use All Edge Locations (Best Performance)).
- Alternate Domain Names (CNAMEs)s: add all domain names that you want to be directed at this Distribution
- SSL Certificate : Under SSL you can opt defaut or your custom certificate that depends upon your requirement.(here I am opting custom certificate.)
Note : For Custom SSL Certificate (certificate should be in us-east-1 region
).
Final Step:
- Once the Distribution has been created (can took 15 to 20 minutes)
- Update your DNS CNAME to point to the ___.cloudfront.net address under Route 53.
Still you getting problem please let me know