Hosting Amplify NextJS application SSR Api User-agent is Amazon Cloudfront

0

Is there a way for cloudfront to pass the original user-agent instead of the Amazon Cloudfront as values to the NextJS server APIs?

I have tried several things such as configuring the behavior on the cloudfront on both the Default() and api/ paths to use UserAgentReferrerAgents in the original request policy without any success.

Need some recommendations as our application needs to make some decision on the server side based on the user agent values.

1 Answer
0

Hello,

Thank you for reaching out. My name is Tom from AWS Support Team.

In short, the feature to allow user-agent field from origin request to pass-through CloudFront resource without override is not supported in Amplify at this moment.

The CloudFront resources deployed for an Amplify application are managed by Amplify service team. Therefore, some features from CloudFront is not configurable with Amplify application.

With that said, Amplify service team is aware of the feature request for allowing pass-through of certain fields from client to Amplify application, similar to Origin Request Policies [1] from CloudFront service. This proposed Amplify feature requires rigorous testing and troubleshooting before it can be made available, to ensure compatibility and data integrity for end users. It is for this reason that we do not have a definitive timeline on when this feature will be made available. I would recommend follow on this page [2] for Amplify latest feature update.

I hope the above information helps. Thank you for contacting us through re:Post.

Links and References

[1] https://aws.amazon.com/blogs/networking-and-content-delivery/amazon-cloudfront-announces-cache-and-origin-request-policies/

[2] https://aws.amazon.com/blogs/aws/category/mobile-services/aws-amplify/

AWS
SUPPORT ENGINEER
Tom_T
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions