Using Lightsail with Cloudfront
I've previously used Cloudfront with S3 and also with WordPress sites hosted on Lightsail. I'm now trying to set up a Cloudfront distribution for standard websites (non WordPress) hosted on Lightsail, (without a Load Balancer). I note that the Cloudfront distribution seems to hit the 'default' Lightsail page (This can be the Plesk default page if you're using Plesk or the default website - if you have set one as default). There doesn't seem to be any way of targeting a second or third site hosted on the Lightsail instance with a Cloudfront distribution. Does this mean I can only have one Cloudfront distribution for a single site on a Lightsail instance or has anyone come across a workaround?
The answer is to amend the CloudFront distribution to Whitelist HTTP headers. You can then choose to forward the Host header from CloudFront to your origin.
Relevant questions
Lightsail Load Balancer with Plesk Ubuntu Wordpress Instances
asked a month agoLightsail with WAF
Accepted Answerasked 2 years agoLightsail container as CloudFront Origin returns 404 No Such Service
Accepted Answerasked 4 months agoOAI or not OAI for serving a static website in S3 using CloudFront
asked 3 months agoFailing to set Cloudfront up on a Wordpress Lightsail Instance
asked 6 months agoUsing Lightsail with Cloudfront
asked 2 years agoHow to connect a Lightsail instance to AWS CloudFront?
asked 5 years agoHow to use https with S3 (Alternate Domain Names) and Cloudfront
asked 3 years agoadding a subdomain to route 53 with cloudfront
asked 4 months agoUnable to run Cloudfront with Lightsail
asked 5 months ago