-
Notifications
You must be signed in to change notification settings - Fork 132
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
Redirects don't preserve query params #935
Comments
Yeah, we already set "Query String Forwarding and Caching" to "Forward all, cache based on all", which means all query strings in viewer requests are included in the cache key and are automatically included in requests that CloudFront sends to the origin. That's why if we go to https://extensionworkshop.com/documentation/themes/?utm_source=addons.mozilla.org&utm_medium=referral&utm_content=dev-hub-legacy-menu-link, we see the query params are preserved. The problem lies in S3. Particularly, we previously solved the "redirect URLS without a slash to the slashed variant" problem in #586, where we leveraged the |
@bqbn I've filed an issue to workaround this by ensuring links don't cause a redirect for now. Are there any alternatives? Would it be possible to have cloudfront -> nginx -> s3 for example? Thinking ahead, would GCP provide a different solution that would enable redirects to work without losing query params? |
Using Nginx between CloudFront and S3 can be an option. That would require us to change the current architecture design, and maintain a couple of Nginx instances. A second option may be to leverage the Lambda@Edge to append a slash to the path. We can try this first IMO. The design and technology used by extensionworkshop.com are applied to a few other static websites that cloudops supports, but AFAIK, ops hasn't looked into how to implement static websites in GCP yet. The best I can tell at this point, moving static websites to GCP is low priority, and will probably happen in later 2022, if at all. That should give us some time to research and experiment how to do it later. |
As noted in mozilla/addons#8234 a redirect doesn't appear to preserve query params.
For example:
https://extensionworkshop.com/documentation/themes?utm_source=addons.mozilla.org&utm_medium=referral&utm_content=dev-hub-legacy-menu-link
is redirected to:
https://extensionworkshop.com/documentation/themes/
Presumably this relates to s3 or cloudfront configuration? Can this be updated to preserve query params?
According to https://stackoverflow.com/questions/30775068/amazon-s3-redirect-rule-preserve-query-params#30798325 there's an option under CloudFront > Behaviors > Forward Query Strings. Though there are also other references in the same question that suggest this doesn't always work.
The text was updated successfully, but these errors were encountered: