Roger Rajaratnam
03/19/2022, 12:21 AMmanitej
03/19/2022, 3:14 AMFrank
Roger Rajaratnam
03/22/2022, 10:39 AMRoger Rajaratnam
03/22/2022, 10:49 AMRoger Rajaratnam
03/22/2022, 10:50 AMFrank
Frank
Frank
In order for all the features of your site to work correctly, you must instead use your S3 bucket's Static Website Hosting Endpoint as the CloudFront origin
But if you are using the StaticSite
construct, the CloudFront distribution is using the S3 Bucket as Origin
. Instead of what Gastby suggests which is enabling the static hosting option on the S3 bucket and using the static hosting URL as an HTTP Origin
.Frank
Devin
03/23/2022, 12:55 PMRoger Rajaratnam
03/23/2022, 3:06 PMRoger Rajaratnam
03/23/2022, 3:08 PMfunction handler(event) {
var request = event.request;
var uri = request.uri;
// Check whether the URI is missing a file name.
if (uri.endsWith('/')) {
request.uri += 'index.html';
}
// Check whether the URI is missing a file extension.
else if (!uri.includes('.')) {
request.uri += '/index.html';
}
return request;
}
Roger Rajaratnam
03/23/2022, 3:09 PMRoger Rajaratnam
03/23/2022, 3:12 PMRoger Rajaratnam
03/23/2022, 3:15 PMDevin
03/23/2022, 3:21 PMRoger Rajaratnam
03/23/2022, 3:25 PMRoger Rajaratnam
03/24/2022, 5:09 PMRoger Rajaratnam
03/24/2022, 5:09 PMRoger Rajaratnam
03/24/2022, 5:11 PMDevin
03/27/2022, 5:57 PMarn
from the s3 bucket in the console. But yours has an ID. Is that because your cert is from an external, non route53 cert?Roger Rajaratnam
03/28/2022, 9:24 PMAWS Certificate Manager > Certificates > domain
My domain is registered with Gandi.net, so it is external, if you have your domain registered via Route52, then you can just use
domainName: "<http://domain.com|domain.com>",
domainAlias: "<http://www.domain.com|www.domain.com>",
Devin
03/28/2022, 9:26 PMRoger Rajaratnam
03/29/2022, 3:16 PMRoger Rajaratnam
03/29/2022, 3:16 PMDevin
03/29/2022, 3:31 PM