Amazon CloudFront is a web service for content delivery. It integrates with other Amazon Web Services to give developers and businesses an easy way to distribute content to end users with low latency, high data transfer speeds, and no commitments.
Questions tagged [amazon-cloudfront]
4907 questions
82
votes
4 answers
Amazon S3 Redirect and Cloudfront
I'm trying to setup 301 redirects on S3 using objects, referenced here http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html. I've been having some problems and can't seem to figure out what I'm doing wrong.
What I get is a…

Matt Smith
- 3,479
- 2
- 28
- 29
79
votes
18 answers
Cloudfront custom-origin distribution returns 502 "ERROR The request could not be satisfied." for some URLs
We have a Cloudfront distribution with custom origin that has been working just fine for quite a long time, serving static assets for one of our sites. Just this morning, we noticed that our logo was displaying as a broken link.
Upon further…

David Eyk
- 12,171
- 11
- 63
- 103
77
votes
13 answers
AWS CloudFront access denied to S3 bucket
I am trying to setup CloudFront to serve static files hosted in my S3 bucket. I have setup distribution but I get AccessDenied when trying to browse to the CSS (/CSS/stlyle.css) file inside S3 bucket:
AccessDenied
…
Primoz Rome
- 10,379
- 17
- 76
- 108
77
votes
3 answers
Amazon CloudFront Doesn't Respect My S3 Website Bucket's index.html Rules
I'm hosting a static website on Amazon S3 using the static website hosting option, so that S3 will render a folder without making me explicitly point to my index.html file.
For instance, here is a direct link to a page in my S3 bucket:…

rdegges
- 32,786
- 20
- 85
- 109
68
votes
5 answers
How to make CloudFront never cache index.html on S3 bucket
I have a React app hosted on an S3 bucket. The code is minified using yarn build (it's a create-react-app based app). The build folder looks something like:
build
├── asset-manifest.json
├── favicon.ico
├── images
│ ├── map-background.png
│ └──…

ffxsam
- 26,428
- 32
- 94
- 144
63
votes
5 answers
AWS CLI CloudFront Invalidate All Files
I am attempting to invalidate an entire static website. The following command does not seem to invalidate /index.html and gives an odd output of items to be invalided, as shown below. Is this AWS CLI behaviour normal or am I missing something?…

neutreno
- 694
- 1
- 5
- 10
52
votes
9 answers
Redirect to index.html for S3 subfolder
I have a domain example.com. I have a S3 bucket named example.com setup with an index.html file that works. Now I like to create two subfolders called old and new, each containing a separate version of a single page application. Requesting…

g3blv
- 3,877
- 7
- 38
- 51
51
votes
7 answers
Receive AccessDenied when trying to access a page via the full url on my website
For a while, I was simply storing the contents of my website in a s3 bucket and could access all pages via the full url just fine. I wanted to make my website more secure by adding an SSL so I created a CloudFront Distribution to point to my s3…

Kurt King
- 1,952
- 2
- 11
- 12
49
votes
3 answers
Restricting access to CloudFront by IP
I want to restrict bucket access to certain IPs. I know how to create a bucket policy from Restricting Access to Specific IP Addresses.
My question: Can this work with CloudFront? How? Can I allow only certain IPs to access CloudFront?

Moshe Shaham
- 15,448
- 22
- 74
- 114
49
votes
4 answers
How to CNAME to Amazon API Gateway Endpoint
I'm trying to set a CNAME on Cloudflare to point to an Amazon API Gateway endpoint. The CNAME is for use when referring to one of my subdomains. The gateway in turn points to the IP of a server on DigitalOcean. I am very new to Amazon web services…

Silian Rails
- 897
- 1
- 8
- 14
47
votes
5 answers
Lambda@Edge not logging on cloudfront request
As explained in the Docs , I set up Lambda@edge for cloudfront trigger of Viewer Response.
The lambda function code :
'use strict';
exports.handler = (event, context, callback) => {
console.log('----EXECUTED------');
const response =…

formatkaka
- 1,278
- 3
- 13
- 27
46
votes
6 answers
How do you add CloudFront in front of API Gateway
API Gateway (APIG), while it uses CloudFront (CF) it does not support CDN edge caching. When I configured a CF distribution to use APIG as the custom origin, I get a permission denied error.
How do I configure CF to fix this?

rynop
- 50,086
- 26
- 101
- 112
44
votes
6 answers
Custom domain for API Gateway returning 403
I am creating an api using API Gateway and Lambda. Using the url designated in the API Gateway Stage editor everything works fine; however, when I try and move to a custom domain I am running into some issues.
The first thing I tried was using a…

BBS
- 1,351
- 2
- 12
- 27
44
votes
5 answers
Why does Browser still sends request for cache-control public with max-age?
I have Amazon S3 objects, and for each object, I have set
Cache-Control: public, max-age=3600000
That is roughly 41 days.
And I have Amazon CloudFront Distribution set with Minimum TTL also with 3600000.
This is the first request after clearing…

Akash Kava
- 39,066
- 20
- 121
- 167
43
votes
2 answers
Getting started with secure AWS CloudFront streaming with Python
I have created a S3 bucket, uploaded a video, created a streaming distribution in CloudFront. Tested it with a static HTML player and it works. I have created a keypair through the account settings. I have the private key file sitting on my desktop…

Oli
- 235,628
- 64
- 220
- 299