如何在 AWS CloudFront 中配置查询参数 [英] How to configure Query Params in AWS CloudFront

查看:40
本文介绍了如何在 AWS CloudFront 中配置查询参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在包含我的前端应用程序的 S3 存储桶之前有一个 AWS 云前端 (

https://docs.aws.amazon.com/AmazonCloudFront/最新/DeveloperGuide/QueryStringParameters.html

I have an AWS cloudfront ahead of an S3 bucket that contains my frontend app (https://myapp.com). When I go to https://myapp.com/experts?profession=carpenter through the navigation elements of my site (button in this case) everything works fine. But when I try to access this same url by manually entering the url from the navigation bar of the browser the problem appears. The query params disappear and only in the navigation bar is the following url without the query params https://myapp.com.com/experts.

My question is, how should I configure AWS cloudfront to allow me to pass query parameters?

Many thanks!

解决方案

For web distributions, you can choose whether you want CloudFront to forward query strings to your origin and, if so, whether to cache your content based on all parameters or on selected parameters.

By default, Cloudfront does not forward query strings, to improve the cache hit rate.

You can change that parameters in the behaviour definition, as per screenshot below.

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/QueryStringParameters.html

这篇关于如何在 AWS CloudFront 中配置查询参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆