Using Lightsail with Cloudfront

0

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?

GTec
asked 4 years ago588 views
1 Answer
0

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.

GTec
answered 4 years ago
  • how do you do this in lightsail? edit the way you do this with lightsail is in your distribution's Directory and file overrides, you need to specify path to directories to NOT CACHE. files in those directories seem to recieve full http headers and for webhooks shouldnt be cached anyways.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions