cars.seraphin.be
). Do not enable the "use this bucket to host a website" option, as it would make the bucket accessible directly, bypassing Cloudfront. We do not want this as Cloudfront can enforce security policies for the bucket (e.g. geographical restrictions). Allowing the bucket to be accessed directly would defeat this entire purpose.s3-spa-deployer
policy to include the 2 new lines under the Resource
array:/*
after the root resource).internal_developers
)aws-cli
installed and that your AWS user should be stored in ~/.aws/credentials
:package.json
file. Note the --recursive
flag to let aws-cli
know that the whole set of files should be uploaded and the --profile seraphin
that specifies the profile to use.cars.seraphin.be
). If multiple domains redirect to the same CloudFront distribution (e.g. auto-assurance.be
& www.auto-assurance.be
), you can add multiple CNAMEs separated by a coma. Ensure you select "Redirect HTTP to HTTPS". Finally, make sure that you input index.html
as the root object for the distribution (so that when the bare URL is input, this file gets loaded).qsdiodazio.cloudfront.net
), you will need it for the DNS setup./comments
route, CloudFront will initially try to serve the comments
object from S3. Since this object does actually not exist (because in a Vue.js SPA all we have is an index.html
file), this will yield either a 403
or 404
error depending on the permissions you have setup. To circumvent this, we must tell CloudFront to serve the /index.html
page for any and all of these errors, replacing the status code by 200
. This way, CloudFront will actually still pass the route path to Vue.js, which will be able to serve the correct router component accordingly.cars
=> qsdiodazio.cloudfront.net
). Make sure to click the little cloud so that it becomes grey: Cloudflare should only be used as a DNS for this, because otherwise it would be redundant with CloudFront's CDN and SSL resolution capabilities.curl
and inspecting the response text:curl -i https://bucket-name.com