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 年前檢視次數 69 次
1 個回答
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
支援工程師
Tom_T
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南