Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-agent modified by cloudfront #1993

Closed
4 tasks done
surajsararf opened this issue Jun 24, 2021 · 7 comments
Closed
4 tasks done

User-agent modified by cloudfront #1993

surajsararf opened this issue Jun 24, 2021 · 7 comments
Labels
archived This issue has been locked. feature-request New feature or request redirects

Comments

@surajsararf
Copy link

Before opening, please confirm:

App Id

djh7fyxc2u06x

Region

region=ap-south-1

Amplify Console feature

Build settings, Custom headers, Redirects

Describe the bug

I create a project and upload a zip file that consists of an index.html and add redirect rules

Source address: <*>
target address: https://abc.com/<*>
Type: 200 (Rewrite)

And it is totally working except user-agent that I am getting this at https://abc.com server

user-agent = Amazon CloudFront

Expected behavior

Expecting User-Agent

user-agent = Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.72 Mobile Safari/537.36

Reproduction steps

Please follow the above stepsfollow

Build Settings

No response

Additional information

How can I solve this issue? Please help.

@github-actions
Copy link

Hi 👋, thanks for opening! While we look into this...

If this issue is related to custom domains, be sure to check the custom domains troubleshooting guide to see if that helps. Also, there is a more general troubleshooting FAQ that may be helpful for other questions.

Lastly, please make sure you've specified the App ID and Region in the issue!

@kahdojay kahdojay added the feature-request New feature or request label Mar 2, 2022
@anatolzak
Copy link

Is there any progress on this issue?

As of now, it is impossible to use AWS Amplify Rewrites for rewrites to an external API because the user agent is modified to be Amazon CloudFront instead of the user's user agent.

When will this be fixed?

@dchanmaisonette
Copy link

Yes, I would like to know when this can be addressed as well.

@gilliardmacedo
Copy link

gilliardmacedo commented May 15, 2023

Yes, and since it's not possible to use Lambda@Edge or see the CloudFront distribution, there's no workaround.

It's important to SSR features and since 2020 it's possible to forward without use the header in cache policy:

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

Over time, we’ve seen numerous cases in which the new functionality could be useful for customers. Examples such as:

Forwarding information such as the User-Agent to the origin for analytics/logging but without serving different content variants based on device type (now you can forward the user-agent header and exclude it from the cache-key)

@mauerbac
Copy link
Member

This feature has just been supported with our latest launch! Closing.

Check out the details here: https://aws.amazon.com/blogs/mobile/cdn-caching-improvements-for-better-app-performance-with-aws-amplify-hosting/

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Copy link

This issue has been automatically locked.

@github-actions github-actions bot added the archived This issue has been locked. label Aug 13, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This issue has been locked. feature-request New feature or request redirects
Development

No branches or pull requests

7 participants