Questions tagged [amazon-cloudfront]
Amazon CloudFront is a content delivery network (CDN) offered by Amazon Web Services.
402
questions
158
votes
8
answers
159k
views
Amazon Cloudfront with S3. Access Denied
We're trying to distribute out S3 buckets via Cloudfront but for some reason the only response is an AccessDenied XML document like the following:
<Error>
<Code>AccessDenied</Code&...
52
votes
8
answers
47k
views
Chrome S3 Cloudfront: No 'Access-Control-Allow-Origin' header on initial XHR request
I have a webpage (https://smartystreets.com/contact) that uses jQuery to load some SVG files from S3 through the CloudFront CDN.
In Chrome I will open an Incognito window as well as the console. Then ...
34
votes
2
answers
41k
views
No Cache-Control Header for files from AWS CloudFront with S3 Origin
We just migrated to Amazon AWS. We currently have an EC2 instance that's working well. It's running Nginx in front and Apache in the back-end. That's running well also. All sites are launched properly ...
28
votes
4
answers
72k
views
Setting Access-Control-Allow-Origin on Cloudfront
I am having problems serving static assets to Firefox using AWS Cloudfront.
Chrome works perfect, but Firefox is returning a CORS error.
If I execute curl , I get:
HTTP/1.1 200 OK
Content-Type: ...
27
votes
4
answers
32k
views
Why S3 website redirect location is not followed by CloudFront?
I have a website hosted on Amazon S3. It is the new version of an old website hosted on WordPress.
I have set up some files with the metadata Website Redirect Locationto handle old location and ...
25
votes
6
answers
14k
views
Blue/Green deployments with CloudFront
I'm looking for a way to do Blue/Green deployments with CloudFront.
Does anyone have a good solution for moving from one CloudFront distribution to another or does everyone really just create their ...
18
votes
1
answer
10k
views
What is an Amazon Route53 "Alias" DNS record?
AWS Route53 Alias value
Consider a domain registered on AWS Route53. HTTP requests to this domain should be served from a AWS CloudFront CDN distribution. In order to achieve this, an alias A record ...
16
votes
5
answers
17k
views
HSTS on Amazon CloudFront from S3 origin
Is it possible to set HSTS headers on an Amazon CloudFront distribution from a S3 origin?
16
votes
3
answers
6k
views
How can I use https with AWS Cloudfront without paying $600 to upload my cert?
I can host a dynamic website through Amazon CloudFront because they have CNAME Wildcard Support. However, some pages of my Site use HTTPS. Amazon have some documentation about how to associate your ...
14
votes
3
answers
24k
views
Forcing CloudFront to pass-through the latest HTML file from S3
Background
I'm hosting a static site on S3, with CloudFront over the top. The issue I have is with my HTML files.
According to CloudFront's FAQ:
Amazon CloudFront uses these cache control headers to ...
13
votes
1
answer
10k
views
Any drawbacks to AWS certificate manager wildcard certificates?
Let's say I'm using AWS Certificate Manager to get a certificate for example.com for use with AWS CloudFront. I can specify an alternate domain of www.example.com and point it to another CloudFront ...
13
votes
1
answer
9k
views
Serving website from Cloudfront and S3 without public bucket
When serving a website via CloudFront from an S3 bucket, I would typically apply the following Bucket Policy to allow access to my files:
{
"Version": "2012-10-17",
"Statement": [
{
...
11
votes
4
answers
10k
views
Amazon Cloudfront with S3 Redirect
I'm trying to do something that should be relatively straight-forward - I want to setup a few domains and subdomains to redirect to the core domain for our site, but I want to put the redirects out on ...
10
votes
4
answers
9k
views
Should AWS CloudFront *increase* load time for infrequently accessed files?
I am new to CDNs and experimenting with CloudFront. I have set everything up and all appears to be working fine. I can create a static image on a page and access it though my CloudFront distribution. ...
9
votes
2
answers
11k
views
Configure AWS Cloudfront to log to S3 bucket in another AWS account
I have some AWS Cloudfront distributions spread out across different AWS accounts.
I'd like to store the access logs from these distributions in a single S3 bucket in a single AWS account.
This is ...
9
votes
4
answers
16k
views
How can I use AWS CloudFront and API Gateway side by side for the same domain?
I'm putting that static assets of my website on S3, and setting up CloudFront to distribute them. These essentially holds the content users would need for any GET request on my site, to existing paths ...
9
votes
2
answers
5k
views
AWS Cloudfront multiple origins - how can we fallback to 2nd origin if not found in the 1st
We're trying to set up a Cloudfront distribution where the default origin is S3, but if the content is not found on S3, we want it to fetch it from an EC2 instance.
Can we setup these multiple ...
9
votes
2
answers
4k
views
OPTIONS request to CloudFront distribution with managed CORS-With-Preflight policy returns 403
I have a CloudFront distribution with a default behavior that is configured to allow any CORS request including preflight requests. However, the OPTIONS request will fail with an HTTP 403 error (...
9
votes
1
answer
831
views
Is it possible to avoid costs for invalid requests at AWS S3 or cloudfront during a DDoS attack?
There are many tutorials in the internet, that promote cheap hosting of static websites via AWS S3 + AWS Cloudfront (+ Cloudflare).
Example of these would be:
Host a website using S3, CloudFront and ...
8
votes
3
answers
10k
views
Using EC2 as a Cloudfront Origin Server
Amazon has recently added the ability to use any server as an origin server for Cloudfront, removing the original S3 only restriction.
My question is- how do I set this up? The AWS web-gui seems to ...
8
votes
2
answers
17k
views
CloudFront S3 Access denied
I have one account with privilege to manage S3 (S3_User), and another one to manage Cloud Front (Cloud_Front_User).
Now, I've created a bucket "bucketname" with S3_User and a distribution with ...
7
votes
2
answers
26k
views
Static IP for cloudfront
Is there any way to bind static IP to my cloudfront distribution?
I'm wondering if VPC can make that work.
I need static IP just to eliminate the problem of allowing in my firewall everytime AWS ...
7
votes
1
answer
2k
views
Does using CloudFront just to enable https make sense?
If I have an EC2 instance, running a web app (HTTP), and I have an Amazon-provided SSL certificate, I can use CloudFront to make the EC2 instance accessible via HTTPS, handling the certificate ...
7
votes
2
answers
2k
views
Does Amazon CloudFront charge for storage? [closed]
I've been reviewing the features and prices of Amazon S3 and Amazon CloudFront as well as similar services offered by other providers. One thing I can't understand is why Amazon CloudFront pricing ...
7
votes
3
answers
11k
views
How to store a Cloudfront custom error page in S3?
I have a Cloudfront plugged on an AWS load balancer.
I saw in the AWS documentation that I can customize Cloudfront custom error pages. I tried to store these error pages in S3 as it is recommended ...
7
votes
2
answers
10k
views
Prevent Cloudfront from forwarding part of path to origin server
Background:
I have an S3 Bucket ( Origin 1) that serves a static website under a the domain example.com using Cloudfront.
Goal:
Additionaly i want example.com/subfolder to serve content from second....
7
votes
1
answer
4k
views
Is there a need for WAF in static website front with REST API?
I have two webistes
www.mysite.com. -->hosted on s3 , served via Cloudfront static single page App.
Then I have api.mysite.com , which the front end uses.
My company is using WAF solution from ...
7
votes
1
answer
20k
views
AWS Cloudfront + Load Balancer, url changes from main domain to load balancer subdomain
My setup is as follows:
user types example.com on the browser
request goes to AWS CloudFront, which redirects HTTP to HTTPS, and
forwards the request to the AWS Elastic LoadBalancer
(elb.example.com)
...
7
votes
1
answer
6k
views
Using Amazon s3 and Cloudfront what is the best way to set expires headers and cache expiration
We have a huge bucket of photos on s3. We add and remove from this daily but it currently has millions of photos that we don't want to rewrite or update if possible.
We have not set any expires ...
7
votes
1
answer
6k
views
Why is only index.html available from an S3 bucket served by CloudFront, and nothing else?
I am trying to expose a static site hosted in S3 though CloudFront.
The S3 bucket (testyop1) is set to host static websites (not in public mode) and its bucket policy is
{
"Version": "2008-10-17"...
7
votes
3
answers
2k
views
Strict-Transport-Security on CloudFront with S3 origin?
My company's site has a static homepage for speed and cost reasons. We use S3 as the origin for CloudFront. Now, we would like to declare Strict-Transport-Security for the entire domain, but S3 seems ...
7
votes
0
answers
946
views
What's the best way to simulate being behind China's Great Firewall? [closed]
We're having issues with an iOS app of ours that uses in-app purchase to unlock downloadable content - but it seems only from China. We see many negative reviews from China for this reason.
Our in ...
6
votes
1
answer
18k
views
Send custom Host header with CloudFront
I have an ELB that I want to put behind CloudFront. Let's say the ELB is example.us-east-1.elb.amazonaws.com. It only accepts requests with the Host header set to www.example.com, which I now want to ...
6
votes
1
answer
11k
views
I get a 403 when requesting a JS file from CloudFront
This is new to me so please excuse me if I have no idea what I'm talking about (: I'm trying to set up my own CDN with CloudFront and S3 through a subdomain by adding a CNAME to that subdomain to ...
6
votes
1
answer
5k
views
AWS CloudFront Default Root Object and subdirectories
I'm hosting a Jekyll blog on S3 and CloudFront. Setting the default document on S3 works fine and all sub folders natively go to index.html.
On my CloudFront distribution, I have set the Default Root ...
6
votes
1
answer
5k
views
Should I use CloudFront in front of API/Web just because I want them on a single domain?
I typically develop my applications with frontend single page application on S3 and backend APIs on a server typically elastic beanstalk (so ELB + EC2). I am confused over what is a good choice to put ...
6
votes
1
answer
3k
views
How to map subdomain in CloudFront to the same name in S3?
I have been searching for a way to do the following if someone can enlighten me would be greatly appreciated.
e.g. would the following mappings be possible in a single CloudFront instance?
feature-a....
6
votes
1
answer
4k
views
AWS: How to redirect many domains to a page on another domain?
My objective
I have a number of domains (e.g. 10 or 20) and I would like to redirect any visitors to anywhere on those pages to one page on another domain (for example my stackoverflow.com profile ...
6
votes
1
answer
2k
views
S3/Cloudfront CORS working on some files only
I'm really struggling to get Cloudfront and S3 to add Access-Control-Allow-Origin: * to the headers of video files stored on S3 (for inline video on iPhones - seems to be working everywhere else ...
5
votes
1
answer
10k
views
How do I route Cloudfront with multiple origins?
So I have 2 Wordpress sites hosted as such
http://siteA.mydomain.com
http://siteB.mydomain.com
I have a distribution created that has the 2 domains above as the origin.
siteA.mydomain.com
...
5
votes
2
answers
3k
views
Webstats for large Amazon S3/Cloudfront logs?
I'm trying to find a way to parse our Amazon S3 access logs to get some webstats.
I've been trying to use AWStats 7, but I got to the point of where after day 9 of a given month it can't process any ...
5
votes
1
answer
749
views
Blue/green deployment - AWS Cloudfront with ELB as custom origin
I have following configuration:
Cloudfront - ELB - AutoScalingGroup - EC2s
Cloudfront serves file-[hash].js files (with chunkhash in their names) from custom origin (ELB).
EC2s serve the file-[hash]...
5
votes
3
answers
6k
views
How to restrict access just to cloudfront from a custom origin server?
if i understood well, in order to create a custom origin distribution, I need to make public those files on my custom origin server.
In my case, that will be put those files into a public dir of an ...
5
votes
0
answers
909
views
Multi-tenant (multi-domain / multi-certificate) on AWS Cloudfront
I have AWS CloudFront serving content (from EC2/etc), this works fine.
The content I have is 'multi-tenant' in that it adjusts its branding/theme based on the domain being used. In theory I would just ...
4
votes
2
answers
3k
views
Blue/Green deployments with CloudFront with equal proportion
Two CloudFront Distributions :
The option I attempted was to have two separate CloudFront Web Distributions, one for a static site in s3 bucket (A version) and other for another static site in s3 ...
4
votes
1
answer
3k
views
Setting "Object Caching" on CloudFront
I want to set the "Object Caching" of my CloudFront distribution with S3 origin to "Customize".
I follow these steps on the console:
go to the "behavior" tab of the relevant distribution
"Edit ...
4
votes
4
answers
18k
views
AWS S3, CloudFront, web font CORS error
I've just moved from my previous CDN to CloudFront for two of my websites. First one is working fine but I used the same snapshot in DigitalOcean to create the 2nd site and here I am getting
...
4
votes
1
answer
4k
views
Can I use CloudFront to serve a WordPress blog from the same domain, but a different server?
We have a website that we serve from Elastic Beanstalk (AWS), and it all works great. We use the built-in load balancer to serve our site over HTTPS, etc. Our database is separated through the RDS ...
4
votes
1
answer
4k
views
CloudFront Distribution for Origins in Multiple Regions
Is there a way to point CloudFront to different origin servers based on location?
We currently use Route53 latency-based routing to direct traffic to east or west region elastic load balancers. ...
4
votes
1
answer
168
views
Is Amazon s3 required if am using Cloudfront for files
I am planning to host a website in Amazon Ec2 instant. I got some basics from the docs.
But I have few confusions.
If am using cloudfront for CDN, do i really need to server files from s3? The site ...