amazon-cloudfront

Rails assets Cloudfront fontawesome CORS

只谈情不闲聊 提交于 2021-02-07 12:16:36
问题 I tried a lot of solutions found on stackoverflow/github for this issue but I can't get it to work. I'm using font-awesome-rails and I precompile my assets for production. I've set CloudFront for my assets in my production config: config.action_controller.asset_host = "https://XXXX.cloudfront.net" When I load a page (from Chrome/Firefox because Safari is OK with CORS) I get this common error message : Font from origin 'https://XXXX.cloudfront.net' has been blocked from loading by Cross-Origin

Enabling POST/PUT/DELETE on AWS CloudFront?

只愿长相守 提交于 2021-02-07 12:15:24
问题 In AWS CloudFront I set this within: "Allowed HTTP Methods" in the "Default Cache Behavior Settings" area: GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE My CloudFront is linked to an AWS S3 bucket. So I set the AWS S3 CORS configuration to: <?xml version="1.0" encoding="UTF-8"?> <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <CORSRule> <AllowedOrigin>*</AllowedOrigin> <AllowedMethod>GET</AllowedMethod> <AllowedMethod>PUT</AllowedMethod> <AllowedMethod>POST</AllowedMethod>

Rails assets Cloudfront fontawesome CORS

百般思念 提交于 2021-02-07 12:14:37
问题 I tried a lot of solutions found on stackoverflow/github for this issue but I can't get it to work. I'm using font-awesome-rails and I precompile my assets for production. I've set CloudFront for my assets in my production config: config.action_controller.asset_host = "https://XXXX.cloudfront.net" When I load a page (from Chrome/Firefox because Safari is OK with CORS) I get this common error message : Font from origin 'https://XXXX.cloudfront.net' has been blocked from loading by Cross-Origin

Enabling POST/PUT/DELETE on AWS CloudFront?

落爺英雄遲暮 提交于 2021-02-07 12:13:43
问题 In AWS CloudFront I set this within: "Allowed HTTP Methods" in the "Default Cache Behavior Settings" area: GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE My CloudFront is linked to an AWS S3 bucket. So I set the AWS S3 CORS configuration to: <?xml version="1.0" encoding="UTF-8"?> <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <CORSRule> <AllowedOrigin>*</AllowedOrigin> <AllowedMethod>GET</AllowedMethod> <AllowedMethod>PUT</AllowedMethod> <AllowedMethod>POST</AllowedMethod>

How to serve an AWS EC2 instance from S3 subdirectory

馋奶兔 提交于 2021-01-29 20:30:55
问题 I have a website hosted on AWS S3, served over Cloudfront. www.mysite.com I am hosting a blog on an EC2 instance. I would like to have this blog served from www.mysite.com/blog For SEO purposes I do not want it to be www.blog.mysite.com Is it possible to achieve this with only S3 and Couldfront? I have played around with S3 redirects and Lambda@edge but the documentation on these is not great. In the case of Lambda@edge I want to avoid further complexity if I can. S3 redirects work but the

Dynamically create new subdomains and point to a cloud front distribution pointing to an s3 bucket

江枫思渺然 提交于 2021-01-29 10:33:21
问题 S3 Bucket in question will have my website files that will be served by a CloudFront distribution. As new customers sign up (It is a multi-tenant serverless application), new subdomains will be created dynamically (not * wild card operator as we wish to serve only valid subdomains associated to customers or redirect to root domain). The website is being served from the same CloudFront distribution/ S3 bucket. How can I dynamically create new subdomains and point to a cloud front distribution

Restrict Amazon S3 website endpoint to CloudFront

与世无争的帅哥 提交于 2021-01-29 09:41:16
问题 Is it possible to restrict an Amazon S3 website endpoint to CloudFront only? I see this is possible for S3 rest endpoints but was wondering if there were any new workarounds to do this for S3 website endpoints. 回答1: For website endpoint you can use bucket policy to allow only CloudFront IP address, not restrictive as OAI but still a way. http://d7uri8nf7uskq.cloudfront.net/tools/list-cloudfront-ips For S3 as an origin, CLOUDFRONT_REGIONAL_EDGE_IP_LIST IP address are not used unless you're

Retrieving CloudFront-Forwarded-Proto with PHP

折月煮酒 提交于 2021-01-29 07:01:54
问题 How can I retrieve CloudFront-Forwarded-Proto using PHP? It appears as a header in the AWS documentation: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/RequestAndResponseBehaviorCustomOrigin.html#RequestCustomRemovedHeaders I tried using $_SERVER['CLOUDFRONT_FORWARDED_PROTO'] or $_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO'] , among others, but without success. How can I do it? What am I missing? I can't find any information or examples on this at all. 回答1: Have you

How to add headers to cloudfront response?

六月ゝ 毕业季﹏ 提交于 2021-01-28 12:17:01
问题 I test my website using https://observatory.mozilla.org/analyze and I got F score. The reasons are: Content Security Policy (CSP) header not implemented X-XSS-Protection header not implemented X-Frame-Options (XFO) header not implemented ... I serve my website using cloudfront. Where I put those missing headers to cloudfront? 回答1: I would recommend using Lambda@Edge to append any headers that you're looking for to your origin response before it is returned to the viewer. It can be done as

Using Cloudfront as a HAProxy backend server with https

夙愿已清 提交于 2021-01-28 11:31:55
问题 I have a CloudFront resource sitting in front of my S3 bucket. It's accessible at — https://<id>.cloudfront.net but if I hit — <id>.cloudfront.net:443 I get a 400 Bad Request. I want to point to CloudFront in my HAProxy configuration, but I can't use the 443 port because of the above-mentioned issue. Nor can I use the https URL protocol in the server statement. backend my_cloudfront_app http-response set-header Strict-Transport-Security max-age=31536000 server my_server <id>.cloudfront.net