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개 답변
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
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠