amazon-cloudfront

Disable Cloudfront cache if file is not found

六眼飞鱼酱① 提交于 2020-05-17 06:24:26
问题 I created a Cloudfront distribution in front of an S3 bucket with a RoutingRule to redirect to a lambda function if the requested file is not found. I´m using this to resize images. Desired flow: Request the file to Cloudfront File not found in Cloudfront check S3 File not found in S3 redirect to the lambda function Lambda will find the original file, resize it and redirect back to the Cloudfront url. Redirect rule set on s3 website: <RoutingRules> <RoutingRule> <Condition> <KeyPrefixEquals/>

Cloudfront give Access denied response created through AWS CDK Python for S3 bucket origin without public Access

谁说我不能喝 提交于 2020-05-16 07:52:06
问题 Created Cloud Front web distribution with AWS CDK for S3 bucket without public access. Able to create Origin access identity, and deploy but on successful deploy i get access denied response on browser. Grant Read Permissions on Bucket from Origin settings will be set to No, setting this to Yes manually everything will work fine, but this setting needs to be achieved through AWS CDK and python. Below is my code. from aws_cdk import aws_cloudfront as front, aws_s3 as s3 class CloudFrontStack

Serve index file instead of download prompt

点点圈 提交于 2020-05-14 01:19:59
问题 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/directory/ The one with the / at the end incorrectly prompts the browser to download a zero byte file with a random hash for the name of the file. Without the slash it returns my 404 page. How can I get both paths to deliver the index.html file within the directory? If there's a way I'm "supposed" to do

Serve index file instead of download prompt

会有一股神秘感。 提交于 2020-05-14 01:18:27
问题 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/directory/ The one with the / at the end incorrectly prompts the browser to download a zero byte file with a random hash for the name of the file. Without the slash it returns my 404 page. How can I get both paths to deliver the index.html file within the directory? If there's a way I'm "supposed" to do

How to make a ReactJS app active/visible on AWS

£可爱£侵袭症+ 提交于 2020-05-09 07:38:06
问题 I developed a reactJS project (front-end) on AWS which has it RESTFUL API coming from heroku. They are completly separated i.e the frontend and backend. I have successfully uploaded my files to S3, and have activated my CloudFront Distributions, but I can't really figure out what is wrong because I can't see my react app when I hit the URL generated from the Domain name. I have checked this SO answer, but it doesn't help. Please any help will be greatly appreciated. 回答1: Firstly, it is

Using public SSL for dynamic domains to map on single cloudfront

限于喜欢 提交于 2020-04-30 09:27:06
问题 I am creating a portal where I am letting my customers map their domains or sub-domains to my CloudFront distribution. So, this way customer comes in and enter a domain name "domainname.com" or "test.domainname.com", and this domain will hit to my CloudFront distribution. I know that we cannot add multiple certificates in CloudFront, but let me explain my requirements. We have a site builder. The site builder application is hosted on my server which is on my datacenter which is NOT on Amazon

CloudFront Error: This XML file does not appear to have any style information associated with it [duplicate]

戏子无情 提交于 2020-04-13 05:29:17
问题 This question already has answers here : CloudFront + S3 Website: “The specified key does not exist” when an implicit index document should be displayed (5 answers) Closed 2 years ago . I have a React app that runs on AWS S3 and CloudFront. When I access the app from the given URL it opens the home page fine. When I navigate to another page using a button on the nav bar it opens the page just fine. But if I then refresh the page I get this error: I also get that same error if I attempt to

Cloudfront returns 403 forbidden when refreshing page

丶灬走出姿态 提交于 2020-04-11 12:41:16
问题 I have uploaded a react app to AWS S3 and am using static website hosting. I then linked a cloudfront distribution to the s3 bucket. I am able to navigate to the site and it functions properly except when I navigate to a new page my-domain/new-page. At first it succeeds but if I try and load the page directly or refresh I get a 403 forbidden error. 回答1: Using react with S3 and CloudFront, I had this or a similar issue where loading the initial index page and then linking to other pages worked

Cloudfront returns 403 forbidden when refreshing page

|▌冷眼眸甩不掉的悲伤 提交于 2020-04-11 12:40:46
问题 I have uploaded a react app to AWS S3 and am using static website hosting. I then linked a cloudfront distribution to the s3 bucket. I am able to navigate to the site and it functions properly except when I navigate to a new page my-domain/new-page. At first it succeeds but if I try and load the page directly or refresh I get a 403 forbidden error. 回答1: Using react with S3 and CloudFront, I had this or a similar issue where loading the initial index page and then linking to other pages worked

Fallback to S3 website subfolder for Angular SPA

旧街凉风 提交于 2020-03-06 10:58:30
问题 I have recently been following the two questions to create a website that serves a multitude of static sites from a S3 domain subfolder: Serving a multitude of static sites from a wildcard domain in AWS Lambda script to direct to fallback S3 domain subfolder when not found What I failed to realise is that within each sub-domain there is a compiled Angular application present. Angular has SPAs which need to fall back to index.html mto effectively let the SPA handle routing. My current