Questions tagged [amazon-cloudfront]
Amazon CloudFront is a content delivery network (CDN) offered by Amazon Web Services.
140
questions with no upvoted or accepted answers
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
0
answers
924
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
0
answers
5k
views
Overriding AWS ALB's default error page(s) with custom one(s) using CloudFront
I have an ALB, containing Rules that forward requests to my private EC2s, hosted on AWS, and when I make a new deployment, I have a script in Lambda that turns off my ASGs and turns them back on. ...
4
votes
1
answer
3k
views
Does CloudFront support S3 signature version 4 for KMS encrypted objects?
I'm using Cloudfront with an S3 origin that is using KMS to encrypt objects. I'm getting the following error when sending a GET request for an object in the S3 bucket.
Requests specifying Server ...
3
votes
1
answer
2k
views
Cloudfront caching resources even though response headers should prevent it
I have recently setup a Cloudfront distribution with the following behaviour cache policy:
TTL settings:
Minimum TTL (seconds): 0
Maximum TTL (seconds): 31536000
Default TTL (seconds): 0
Cache Keys:...
3
votes
1
answer
1k
views
Configure AWS CloudFront to send custom query params to origin
Is it possible to configure my AWS CloudFront distribution to append to the request a custom query param (e.g a private key) before sending it to the origin?
For example, the front end is calling *....
3
votes
0
answers
1k
views
AWS SSL Certificate without Load-Balancer?
I have a standard Elastic Beanstalk app set up and running great over HTTP. Following the AWS Documentation I requested an SSL Certificate and configured it with CloudFront.
Instead of a load-...
3
votes
1
answer
1k
views
CloudFront CDN breaks due to DirectorySlash behavior of Apache
My CDN domain is set to www.mysite.com, and it reads from origin.mysite.com. mod_dir is enabled on apache, and so any request without a trailing slash is redirected with a 301 to the equivalent URL ...
3
votes
0
answers
2k
views
CloudFront + S3 Access Denied Using Signed Cookies
I'm trying to integrate signed cookies for a CloudFront distribution that's fed off of an S3 bucket but getting access denied error messages:
<Error>
<Code>AccessDenied</Code>
...
2
votes
0
answers
372
views
Why is CloudFront failing to pass a header from the origin to the client?
I have CloudFront configured with an API Gateway origin. In the application accessed via API Gateway, my application responds to a particular request with a Content-Disposition header so that the data ...
2
votes
1
answer
206
views
How Do I Use The <VirtualHost> Directive To Host Multiple Sites Using An EC2 Instance, ELB, And CloudFront?
I've been really struggling with this for the past few days, and I'm at a lost. Here's what's going on.
I have an EC2 instance (Amazon Linux 2023) behind an ELB and a CloudFront distribution that I ...
2
votes
0
answers
1k
views
CloudFront CORS request using signed cookies and withCredentials, not sending back Access-Control-Allow-Credentials unless I include some extra header
I'm having a very strange issue that I can't seem to crack. I configured a private CloudFront distribution to serve content from a private S3 bucket. I am using signed cookies to grant access to the ...
2
votes
0
answers
276
views
Why is CloudFront ApiGateway CloudFront-Viewer-Country reporting US as the country for eu-west-1 distribution and viewer in UK?
I have an AWS CloudFront distribution created using CDK (CloudFrontWebDistribution) fronting an ApiGateway, deployed in eu-west-1 (Dublin). I can see in the API logs that the CloudFront-Viewer-Country ...
2
votes
0
answers
2k
views
Access denied for S3 bucket with redirect access via CloudFront
I have public S3 bucket exposed via CloudFront to S3 A record for www.mezinamiridici.cz.
https://www.mezinamiridici.cz/ - works
http://www.mezinamiridici.cz/ - redirects to https://www.mezinamiridici....
2
votes
0
answers
731
views
How to configure Cloudfront for API Gateway with API key enabled?
I configured two API Gateways one with API-key enabled and the other with API-key disabled.
For both the API gateways I configured and enabled CloudFront.
For the API-gateway which has API-key ...
2
votes
1
answer
1k
views
CloudFront usually misses from browser, hits from cURL
When I load my HTML page in my browser, all requests for assets have x-cache: Miss from cloudfront. If I reload my browser very quickly, I can sometimes get a Hit.
If I open my developer tools and "...
2
votes
1
answer
2k
views
Cloudfront (w/ S3) Static Website Doesn't utilize index.html from sub directories
I have my website hosted on S3 with CloudFront as a CDN, and I need these two URLs to behave the same and to serve the index.html file within the directory:
example.com/directory
example.com/...
2
votes
0
answers
21
views
Proper way to handle file serving
We have a website where we our daily bandwidth use is roughly 10GB of user generated contents.
The software layer is simply Heroku + some addons for DB and monitoring,
and we are handling the uploads ...
2
votes
0
answers
2k
views
AWS CloudFront with API Gateway's Base Path Mapping for IPv6 support
We currently have some APIs set up in API Gateway, with a Custom Domain Name defined with a Regional Endpoint and Base Path Mappings that map incoming requests to the appropriate API and deployment ...
2
votes
0
answers
2k
views
Buffering when serving videos through AWS CloudFront
We are hosting videos in AWS S3 in HLS format (lots of .ts files, + playlists .m3u8).
We have configured AWS CloudFront with all Edge locations to serve those files.
We have 2 apps, iOS and Android, ...
2
votes
1
answer
7k
views
Setting up CloudFront [Custom Origin] for EC2 instance
I have been checking things up & down on Google & AWS Documentation but can't seem to nail this one.
I have an EC2 instance setup with a domain being served via a virtual host and I need to ...
2
votes
0
answers
2k
views
Chrome stalled requests for some HTTP2 resources
Issue
Some resources from the CDN take minutes to load because, according to Chrome devtools, are "stalled".
This happens only on Chrome and only the first time I open the page in an incognito ...
2
votes
0
answers
917
views
How to get clean URLs in CloudFront
I'm hosting my static website on AWS S3, with Cloudfront as a CDN, and I'm wondering how I can get clean URLs working.
I currently have to go to example.com/about.html to get the about page. I'd ...
2
votes
0
answers
1k
views
Heroku SSL redirect to www.example.com with AWS Route 53 and Cloudfront
Current Situation
example.com == examplecom and so on because of spam
I've a Domain examplecom on GoDaddy and a SSL cert for it. The real application is hosted on Heroku at exampleherokuappcom. I ...
2
votes
0
answers
782
views
Reverse Proxy on cloudfront
I have an angular site / web application (Lets call this www.mysite.com) hosted on Amazon S3 as a static website.
This s3 bucket serves as the origin for a cloudfront distribution and it works ...
2
votes
1
answer
701
views
Route 53 configuration for Cloudfront distribution linked to S3 bucket for naked domain
I am using route 53 for a domain (example.com) linked to my app on Heroku. To handle naked domain redirection, I am using a S3 bucket as explained here:
https://aws.amazon.com/blogs/aws/root-domain-...
2
votes
0
answers
1k
views
Caching Docker (Cloudfront) images with Squid
I have a Squid server setup with ssl-bump caching SSL resources used by Docker but I'm having issues trying to get it to cache requests to Cloudfront, for example:
1415056176.733 190419 172.17.0.40 ...
2
votes
0
answers
327
views
Cherokee force gzip compression for HTTP/1.0
I am using CloudFront with a Cherokee origin server for static files. Cherokee serves gzipped content for direct browser requests without any problem. But when CloudFront requests content, Cherokee ...
1
vote
0
answers
589
views
AWS CloudFront 404 error on web root only - node.js with express and pug
The Setup
I have a web site built on node.js, express.js, and pug.js running on an AMI Linux instance in AWS. I've given the instance an Elastic IP and if I browse directly to the generated DNS record ...
1
vote
0
answers
47
views
Changing hosting server to a website without having the certificate from the CA
I have been helping a friend who published a wordpress webpage developed by a company he contacted that on production has a really poor performance, to fix this I created a react static web page which ...
1
vote
0
answers
66
views
Cloudfront Origin Domain Name - should you include www
My nginx server is setup so that all URLs example.com/url are forwarded to www.example.com/url
In the cloudfront origin domain when I create the distribution should I enter
example.com or www.example....
1
vote
0
answers
120
views
Cloudfront url routing to a domain
I have a cloudfront url I want to route to demo.example.com. I used nginx for the routing and configuration and generated the ssl certificate and then added the txt records in the DNS portal.
But when ...
1
vote
0
answers
660
views
How do I fix CORS issues in Cloudfront CDN?
I run a WordPress website and recently configured a CDN using CloudFront.
Most of the features are working fine, but I'm experiencing CORS issues with JS files I'm loading from Github.
I have tried ...
1
vote
0
answers
1k
views
How does a CloudFront cache behavior's "Path Pattern" interact with the origin's "Origin Path"?
I have an origin that looks like this: "https://myS3Bucket.s3/static/ui/v1.0.0". This origin has an "Origin Path" that is "/v1.0.0", and the cache behavior associated ...
1
vote
0
answers
147
views
Amazon OpenSearch Service stably or less downtime?
Can anyone point out, What is the best way for the elastic search to run stably? We frequently get messages about it requiring updates and that an update requires some downtime.
Could we have 2 ...
1
vote
1
answer
2k
views
CloudFront does not seem to invoke lambda@edge function
I have a CloudFront distribution. The origin is an S3 bucket that uses OAI.
I have created a lambda@edge function following directions from https://aws.amazon.com/blogs/compute/implementing-default-...
1
vote
0
answers
3k
views
CloudFront gives 403 error when accessing a web app hosted outside AWS through the configured subdomain
I've been tasked with setting up our web app on CloudFront. Our web app is hosted on an Ubuntu server that is completely outside AWS.
I have little to no experience with CDNs, but I've made some ...
1
vote
0
answers
752
views
Can CloudFront handle repeated headers?
According to this answer, you can have multiple headers for certain headers, such as Cache-Control.
Will CloudFront respect both times that Cache-Control appears? For example, if the Origin were to ...
1
vote
0
answers
158
views
React Js + AWS Cloudfront + SaaS + SSL Certificates
This is the scenario I have in mind
SaaS application
Frontend built using React Js
Hosted using S3 bucket + Cloudfront
Customer domains pointing to this application using CNAME
Questions -
Can ...
1
vote
0
answers
189
views
Configure AWS CloudFront to add a default metadata param to the uploaded files
I need to have the Content-Disposition = “attachment” set to all files uploaded to the s3 bucket.
How do I configure CloudFront to create this param and added it to metadata ?
I configured the ...
1
vote
1
answer
1k
views
CloudFront what to use for Origin Domain Name when connecting to Wordpress
I have a Wordpress site set up at site.example.com and I am trying to configure a CloudFront distribution as a reverse-proxy to reduce the load to my origin server.
In the past I have used CloudFlare ...
1
vote
0
answers
153
views
How does Origin Protocol Policy overlap with Viewer Protocol Policy?
The question is about Amazon CloudFront.
The names in the title refer to two types of settings. The former can be edited via the "Origins and Origin Groups" tab, while the latter via the &...
1
vote
0
answers
359
views
domain masking for a cloudfront distribution
I have a domain test.com which is linked to a cloudfront distribution which then serves static content from s3 bucket. Now I want another domain www.test2.com to masked redirect to test.com. I created ...
1
vote
0
answers
310
views
AWS Cognito Hosted UI Bypasses WAF
I have an S3 hosted site behind a Cloudfront and WAF. I set up a Cognito hosted UI with a custom domain (auth.example.com where example.com is my site). Cognito generates a Cloudfront distribution ...
1
vote
0
answers
289
views
Client connects to Cloudfront via HTTP2, then connects to an Apache Server via HTTP1, can HTTP2 vulnerabilities be exploited in the HTTP1 connection?
We have an environment where customers connect to a Cloudfront distribution via HTTP2 and then from the Cloudfront distribution to an Apache web server via a HTTP1 connection.
[ client ] ---(https, ...
1
vote
0
answers
1k
views
Nginx Redirect to EC2 Instance
ORIGINAL
I had angular (version: 7) site which was deployed on S3 bucket, but for SEO purposes, recently I integrated Angular Universal.
Now I moved site/frontend from S3 bucket to EC2 instance. I ...
1
vote
0
answers
4k
views
How to have cloudfront distribution listen on custom port for HTTPS?
I have setup a Cloudfront distribution on AWS with custom domain name to fetch firmware update file from S3. However, the existing devices that we have with customers make an HTTPS request to that ...
1
vote
0
answers
396
views
Amazon S3 - Cloudfront - Images just randomly get permission denied
we have a very strange issue with the images on our websites. From time to time, some images get a permission denied response when our website is requested. These images are in a S3 bucket with ...
1
vote
0
answers
594
views
The way AWS Lambda@Edge accesses to S3 restricted by Object Access Identity (OAI)
I have a question.
Is the Lambda function (written in node.js) associated with CloudFront accessible to S3 objects restricted by Object Access Identity (OAI)?
If yes, could you tell me how to access?
(...
1
vote
0
answers
4k
views
Cloudfront Access Denied, but only on certain files
I've read through several similar issues, but they differ in that
This isn't a website, just CDN for images
I have no subdirectories
I was notified by our marketing dept that some of our photos ...