amazon-cloudfront

How to access AWS CloudFront that connected with S3 Bucket via Bearer token of a specific user (JWT Custom Auth)

做~自己de王妃 提交于 2020-08-05 09:53:07
问题 I am using a serverless framework to deploy a serverless stack to AWS. My stack consists of some lambda functions, DynamoDB tables and API Gateway. I am protected The API Gateway using what's called lambda authorizer. Also, I have a custom standalone self-hosted Auth service that can generate tokens. So the scenario is that the user can request a token from this service (It's IdentityServer4 hosted on Azure) then the user can send a request to the API Gateway with the bearer token so the API

Hosting multiple SPA web apps on S3 + Cloudfront under same URL

末鹿安然 提交于 2020-08-04 04:26:07
问题 I have two static web apps (create-react-apps) that are currently in two separate S3 buckets. Both buckets are configured for public read + static web hosting, and visiting their S3 hosted URLs correctly display the sites. Bucket 1 - First App: index.html static/js/main.js Bucket 2 - Second App: /secondapp/ index.html static/js/main.js I have setup a single Cloudfront for this - The default cloudfront origin loads FirstApp correctly, such that www.mywebsite.com loads the index.html by default

Forwarding Path to Origin in Cloudfront

白昼怎懂夜的黑 提交于 2020-07-08 00:36:56
问题 I am using cloudfront with a cache behavior for /apiA* pointing to OriginBdomain.com/apiB. I would like requests with path /apiA/examplePath to be forwarded to OriginB.com/apiB/examplePath however, requests for /apiA/examplePath are only being forwarded to OriginBdomain.com/apiB is it possible to forward the path as well? 来源: https://stackoverflow.com/questions/62584582/forwarding-path-to-origin-in-cloudfront

Forwarding Path to Origin in Cloudfront

送分小仙女□ 提交于 2020-07-08 00:36:33
问题 I am using cloudfront with a cache behavior for /apiA* pointing to OriginBdomain.com/apiB. I would like requests with path /apiA/examplePath to be forwarded to OriginB.com/apiB/examplePath however, requests for /apiA/examplePath are only being forwarded to OriginBdomain.com/apiB is it possible to forward the path as well? 来源: https://stackoverflow.com/questions/62584582/forwarding-path-to-origin-in-cloudfront

Forwarding Path to Origin in Cloudfront

本小妞迷上赌 提交于 2020-07-08 00:36:10
问题 I am using cloudfront with a cache behavior for /apiA* pointing to OriginBdomain.com/apiB. I would like requests with path /apiA/examplePath to be forwarded to OriginB.com/apiB/examplePath however, requests for /apiA/examplePath are only being forwarded to OriginBdomain.com/apiB is it possible to forward the path as well? 来源: https://stackoverflow.com/questions/62584582/forwarding-path-to-origin-in-cloudfront

How to get client IP of requests via CloudFront?

只愿长相守 提交于 2020-07-02 13:22:33
问题 According to the doc of CloudFront (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/RequestAndResponseBehaviorCustomOrigin.html), client IP can be the front, middle, end of X-Forwarded-For header. Is it rignt? Then how can I get real client IP? 回答1: Is it right? Not exactly. CloudFront follows correct semantics for X-Forwarded-For . Specifically, each system handling the request appends its client's address to the right. This means the rightmost address in X-Forwarded-For

AWS Cloudfront as CDN for Heroku Site with Custom Domain

此生再无相见时 提交于 2020-06-24 13:52:26
问题 Recently, I bought a domain from AWS Route 53 (brianpatrickhummel.com) to host a personal portfolio. The portfolio site is up and running, using an S3 bucket and Cloudfront as a CDN. On the portfolio site, visitors are able to preview some apps that I built, which launch in-site using iframe elements, and I noticed that my Heroku-deployed apps take 10-20 seconds to load, since those sites have very few visitors on average and have no CDN service. Therefore, I began researching using AWS

AWS CloudFront misinterprets routing rule and redirects resource back to S3 bucket object URL

依然范特西╮ 提交于 2020-06-17 02:52:07
问题 I have an AWS S3 bucket; let's call it example.com . I have the bucket configured for static web site hosting; the bucket static site URL for example might be http://example.com.s3-website-us-west-1.amazonaws.com . I also have a CloudFront distribution with an AWS-managed certificate, so that when I access https://example.com/ for example it serves content out of the S3 bucket http://example.com.s3-website-us-west-1.amazonaws.com/ . That all works like a dream. On my site I have a file https:

Cloudfront and Lambda@Edge: Remove response header

我怕爱的太早我们不能终老 提交于 2020-06-15 05:59:10
问题 I am trying to remove some headers from a Cloudfront response using Lambda@Edge on the ViewerResponse event. The origin is an S3 bucket. I have been successful to change the header like this: exports.handler = (event, context, callback) => { const response = event.Records[0].cf.response; response.headers.server = [{'key': 'server', 'value': 'bunny'}]; callback(null, response); }; However it does not seem to work to remove headers all together, e.g. like this. exports.handler = (event, context

Amazon CloudFront vs. S3 --> restrict access by domain?

☆樱花仙子☆ 提交于 2020-05-29 09:44:10
问题 On Amazon S3, you can restrict access to buckets by domain. But as far as I understand from a helpful StackOverflow user, you cannot do this on CloudFront. But why? If I am correct, CloudFront only allows time-based restrictions or IP restrictions (--> so I need to know the IP's of random visitors..?) Or am I missing something? Here is a quote from S3 documentation that suggests that per-domain restriction is possible: ---> " To allow read access to these objects from your website, you can