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-deployerpolicy to include the 2 new lines under the
/*after the root resource).
aws-cliinstalled and that your AWS user should be stored in
package.jsonfile. Note the
--recursiveflag to let
aws-cliknow that the whole set of files should be uploaded and the
--profile seraphinthat specifies the profile to use.
cars.seraphin.be). If multiple domains redirect to the same CloudFront distribution (e.g.
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.htmlas 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.
/commentsroute, CloudFront will initially try to serve the
commentsobject from S3. Since this object does actually not exist (because in a Vue.js SPA all we have is an
index.htmlfile), this will yield either a
404error depending on the permissions you have setup. To circumvent this, we must tell CloudFront to serve the
/index.htmlpage 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.
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.
curland inspecting the response text:
curl -i https://bucket-name.com