amazon-cloudfront

AWS Cloudfront distribute multilingual angular apps

≡放荡痞女 提交于 2019-12-21 05:45:18
问题 I have an Angular app which is store in a AWS S3 bucket and distributed by Cloudfront. Now I want to distribute my app in multiple languages. I've already translated my angular app and for each language I have on build. So my S3 bucket looks like this: de /index.html /script.js en /index.html /script.js For each language I want to serve another app. In Cloudfront I created two Origins which points to Origin Path /de and /en So my URL schema is like this: <appname>.<mydomain>.com/:lang But my

Setting up Amazon Cloudfront without S3

一笑奈何 提交于 2019-12-21 02:38:13
问题 I want to use Cloudfront to serve images and CSS from my static website. I have read countless articles showing how to set it up with Amazon S3 but I would like to just host the files on my host and use cloud front to speed up delivery of said files, I'm just unsure on how to go about it. So far I have created a distribution on CloudFront with my Origin Domain and CName and deployed it. Origin Domain: example.me CName media.example.me I added the CNAME for my domain: media.mydomain.com with

Restricting access to CloudFront by IP

佐手、 提交于 2019-12-20 17:33:17
问题 I want to restrict bucket access to certain IPs. I know how to create a bucket policy from Restricting Access to Specific IP Addresses. My question: Can this work with CloudFront? How? Can I allow only certain IPs to access CloudFront? 回答1: Web Application Firewall is your friend. http://docs.aws.amazon.com/waf/latest/developerguide/web-acl-ip-conditions.html Create your rule with your IP Addresses and rest "WAF" will take care. You need to apply this to the required CloudFront Distribution.

Why is Cloudfront loading scripts in my web app? (I don't use it)

百般思念 提交于 2019-12-20 11:38:26
问题 I manage a secured PHP/MySQL web app with extensive jQuery use. Today, a strange error popped up in our app's logs: JS Error: Error loading script: https://d15gt9gwxw5wu0.cloudfront.net/js/_MY_WEB_APP_DOMAIN_/r.js We are not using Amazon's Cloudfront CDN in our app. When I go to the URL that failed to load, these are the only contents: if(typeof _GPL.ri=='function'&&!_GPL.isIE6){_GPL.ri('_GPL_r')}_GPL.rl=true; The user's user agent string is: Mozilla/5.0 (Windows NT 6.1; rv:9.0.1) Gecko

Map multiple subdomains to same S3-bucket

左心房为你撑大大i 提交于 2019-12-20 09:38:35
问题 Is there some way to map multiple (thousands) of subdomains to one s3-bucket? If so is it also possible to map it to a specific path in the bucket for each subdomain? I want test1.example.com to map to mybucket/test1 and test2.example.com to map to mybucket/test2. I know the last part isn't possible with normal dns-records but maybe there is some nifty Route 53 feature? 回答1: It's not possible with S3 directly. You can only use 1 subdomain with an S3 bucket. However you can map multiple

Cloudfront Lambda@edge set cookie on Viewer Request

你说的曾经没有我的故事 提交于 2019-12-20 06:28:04
问题 Update: Collected my thoughts better I'm generating a unique identifier (UUID) for each user in the Viewer Request Lambda, and then selecting a cached page to return based upon that UUID. This works. Ideally, this user would always have the same UUID. I must generate that UUID in the Viewer Request if it is not present in a cookie on that Viewer Request. I also need that UUID to be set as a cookie, which of course happens in the response not the request. Without caching, my server simply

Presigned S3 URLs with Cloudfront

青春壹個敷衍的年華 提交于 2019-12-19 10:15:12
问题 I want to append my pre-signed URL to a CloudFront URL to use instead any idea how to achieve this? 回答1: Use an Amazon CloudFront Signed URL instead of attempting to use an Amazon S3 pre-signed URL with CloudFront. See: Using Signed URLs - Amazon CloudFront 回答2: I find the question relevant, it matches my needs. I have files stored in S3 Singapore and external consumers in Europe. AWS default bandwidth quality is quite poor (takes several minutes to download a 50 MB file for quite a few of my

Using AWS iOS SDK to fetch files from cloudfront distribuition

我的未来我决定 提交于 2019-12-19 09:20:50
问题 I am using the latest iOS SDK for AWS, and fetching files from S3 works fine using the TransferManager Class S3GetObjectRequest *request = [[S3GetObjectRequest alloc] initWithKey:@"test.png" withBucket:@"my_bucket_name"]; S3TransferOperation * op = [self.tm download:request]; then I wanted to add Cloudfront for better edge serving, but setting the cloudfront distribution as the S3 bucket does not work.. S3GetObjectRequest *request = [[S3GetObjectRequest alloc] initWithKey:@"test.png"

Angular on AWS (Cloudfront/S3) for Safari

匆匆过客 提交于 2019-12-19 08:29:23
问题 I have issues viewing my site on Safari. I know there is lots of information to find but I can't figure out what would actually work. I have an Angular app with angular ui-router, configured like this: $locationProvider.html5Mode(true).hashPrefix('!'); In my index.html <meta name="fragment" content="!"> <base href="/" /> My S3 configuration is like this: <RoutingRules> <RoutingRule> <Condition> <HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals> </Condition> <Redirect> <HostName

AWS S3 + CloudFront gives CORS errors when serving images from browser cache

非 Y 不嫁゛ 提交于 2019-12-19 06:26:11
问题 If I clear my browser cache, everything loads just find from my cloudfront-enabled S3 bucket. When I turn off cache, however, I get errors in the console: Image from origin [ORIGIN URL] has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin [MY LOCALHOST ADDRESS] is therefore not allowed access. MY CORS configuration: <?xml version="1.0" encoding="UTF-8"?> <CORSConfiguration xmlns="http://s3