728%20x%2090%20px

.com/img/a/

This is a good learning site. This contains details of cloud computing, AWS, AWS-CDK, AWS-SDK codes and examples including S3, Redis, lambda, api-gateway, cloudfront, cloudformation.

Add custom header in CloudFront/Pass custom header from Cloudfront

.com/img/a/

Add custom header in CloudFront/Pass custom header from Cloudfront.

Cloudfront has wide use cases and mostly used for hosting the websites.

But there are certain cases where we need to pass the custom header value, which means anything other than existing HTTP headers.

In this case we need to setup some configuration which we will show now.

For this we need to create a Origin Request Policy.

Head to Cloudfront > Policies > Origin Request Tab

CFpolicy

There will be a button to create the origin request policy

CFcreaterequestbtn

Provide the required name and description and then in Headers dropdown select Include the following headers.

CFcreateorignpoly

Then select Add custom button

CFCustomhead

This value should be same as the one which you will send as header name.

Create the origin request with the above configuration.

CForiginrequest

Validate the created origin request. Then let's associate this origin request to our distribution.

Navigate to Cloudfront > distribution > Behaviors tab > edit the behavior 

editbehavior

Then select the newly created behavior as below.

CFSelectBhevior

This was the last step we had to do and we are good to pass the custom header into our Cloud Front 👍.


00:00 / 00:00

No comments:

Post a Comment

If you have any doubts, Please let me know

Copyright 2022, KuchBhiLearning - A free website to learn and code. All rights Reserved.
| Designed by Yaseen Shariff