Questions tagged [amazon-cloudfront]

Amazon CloudFront is a content delivery network (CDN) offered by Amazon Web Services.

Filter by
Sorted by
Tagged with
94
votes
5answers
73k 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&...
30
votes
2answers
21k 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 ...
27
votes
1answer
25k 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 ...
18
votes
2answers
21k 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 ...
15
votes
3answers
5k 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 ...
15
votes
2answers
37k 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: ...
14
votes
5answers
6k 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 ...
13
votes
3answers
21k 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 ...
13
votes
1answer
4k 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 ...
10
votes
4answers
6k views

HSTS on Amazon CloudFront from S3 origin

Is it possible to set HSTS headers on an Amazon CloudFront distribution from a S3 origin?
9
votes
4answers
8k 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
4answers
13k 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 ...
8
votes
3answers
8k 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 ...
8
votes
0answers
763 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 ...
7
votes
3answers
9k 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 ...
7
votes
1answer
5k 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 ...
6
votes
1answer
10k 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) ...
6
votes
2answers
9k 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 ...
6
votes
1answer
365 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 ...
6
votes
1answer
1k 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 ...
5
votes
1answer
9k 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 ...
5
votes
1answer
2k 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 ...
5
votes
1answer
8k 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
1answer
850 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 ...
5
votes
2answers
4k 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 ...
5
votes
2answers
2k 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
1answer
2k 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": [ { ...
5
votes
2answers
2k 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 ...
5
votes
2answers
5k 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 ...
4
votes
2answers
12k 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 ...
4
votes
2answers
1k 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 ...
4
votes
1answer
157 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 ...
4
votes
1answer
267 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 ...
4
votes
1answer
574 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....
4
votes
1answer
4k views

Setting up CloudFront CDN on a cookieless root domain

I have recently set up an AWS S3 bucket for my site's static content, along w/ a CloudFront distribution for my CDN. I have this working using a sub-domain. However, after running YSlow, I realized ...
4
votes
2answers
5k views

CloudFront with Custom Origin and ELB

We are using CloudFront for our static assets but also wanted to allow for Gzip. We set up a new distribution with a custom origin pointing back to our application servers which are behind a elastic ...
4
votes
1answer
2k views

Cloud-front backed with Nginx (which proxies to S3) randomly missing already cached items?

I wish to serve images from a S3 bucket with Cloudfront as CDN frontend, for that I tried the following: What I wish to acheive (Attempt 2) -- (Misses cloudfront cache randomly) I have the ...
4
votes
0answers
831 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 ...
4
votes
0answers
2k views

Amazon S3 + Cloudfront VS Rackspace CloudFiles [closed]

I know this question came up lot of time on the internet , But I couldn't find any latest updates on this . So I gathered the information what I found and putting here and have few questions on it . ...
3
votes
3answers
1k views

CloudFront - Users requests static files non-stop to make your bill high?

I had this weird wondering once. If I am using CloudFront as my CDN, I pay per requests made on my static files. So here comes the wondering. Can one keep requesting the same file in a non-stop ...
3
votes
1answer
2k views

openssl tool cannot get certificate from CloudFront, does anyone know why?

I'm writing a script to check the SSL expiry dates of all my domains. This works for my normal sites: echo | openssl s_client -connect $domain:443 2> /dev/null | openssl x509 -noout -enddate ...
3
votes
1answer
2k 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 ...
3
votes
1answer
4k 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 ...
3
votes
1answer
594 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 ...
3
votes
1answer
3k 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 ...
3
votes
1answer
2k 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. ...
3
votes
1answer
2k views

S3 CORS through CloudFront not working in Firefox

I am using S3 CORS for serving fonts. If S3 domain name is used for serving fonts, it works in Firefox, but when CloudFront is used, it doesn't. Works with Google Chrome. My CORS configuration on S3 ...
3
votes
2answers
3k views

Redirect some URL requests to CloudFront and the rest direct to the normal server?

Say I have two types of URL requests that must be handled by my REST API: http://query.restapi.com/image.png?apikey=abc123 http://query.restapi.com/2.0/<apiKey>/resource.json?from=umi....
3
votes
3answers
3k views

Problems with Gzip compression on Amazon CloudFront

I had a CloudFront distribution configured with S3 as an origin. I have enabled "Compress Objects Automatically" as per Amazon guide. Waited for the distribution status to display "online" then ...
3
votes
1answer
801 views

How to use Let's Encrypt with both EC2 and Cloudfront?

I want to use Let's Encrypt certificates for both EC2 and Cloudfront. I am creating a wordpress installation EC2 t2.micro using Ubuntu 16.04(HVM) AMI and nginx. EC2 region will be us-east-2 (Ohio). ...