2. Create CloudFront distribution
Go to CloudFront - Distributions - Create.
Enter EC2 public dns address.
Select HTTP only because the EC2 will only get 80 port.

Viewer will use HTTPS. So I chose redirect.

A default cache key policy is UseOriginCacheControlHeaders. But it says that a query string is not included in cache key, meaning even a different query string request will use cached data. I didn't want it, so I changed it to UseOriginCacheControlHeaders-QueryStrings policy. This is guided in console UI with example.

I disabled WAF to reduce cost.
I lowered price class to reduce cost.
Enter alternate domain name that I will use.
Select Custom SSL certificate that I made for the domain.

Last updated