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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则