amazon-web-services - Cloudfront 中的白名单授权 header

标签 amazon-web-services header amazon-cloudfront whitelist

我在我的 PHP EC2 服务器上使用 OAuth2。

从我托管在 S3 中的前端客户端,我向我的 ElasticBeanstalk EC2 服务器发出请求(前端和后端都通过带有 SSL 证书的 Cloudfront 提供服务)。

这些请求与所需的访问 token header 一起发送,如 Authorization: header ...
当我收到错误时,Cloudfront 似乎删除了这些 header :

error_description: "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the "access token" parameter."



我正在尝试按照 this documentation 的指示通过 Cloudfront 将此 header “列入白名单”但觉得很困惑。我实际上可以在 Cloudfront 的何处添加 Authorization标题接受?

部分文档说:

You can configure each cache behavior in a web distribution to do one of the following:

  • Forward all headers to your origin


但是我在设置时已经这样做了:

enter image description here
enter image description here
enter image description here

最佳答案

您需要专门whitelist您想要的标题,否则选择 None (Improves Caching)去除所需的标题:

enter image description here

关于amazon-web-services - Cloudfront 中的白名单授权 header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52827824/

相关文章:

ios - Amazon 链接中不提供 AWSiOSSDKv2

node.js - Dynamodb 不频繁计划的扫描

ruby-on-rails - 云端重定向到原点而不是别名

javascript - Rails 4 应用程序 - Heroku/Cloudfront - Assets 未正确从源提供服务

amazon-web-services - 适用于 VPC/VPN 的 AWS Cloudfront

amazon-web-services - 您能否将 LightSail 实例/快照转换为 EC2

python - 通过 AWS lambda 在 EC2 实例上执行 python 脚本

C++ header 保持理智

php - WKHTMLTOPDF -- 是否可以显示动态标题?

Java csv header 动态迭代