CloudFront 加载文本时出现问题,而不是显示 html

发布于 2025-01-15 10:24:52 字数 730 浏览 4 评论 0原文

我正在使用具有以下策略的 CloudFront。

缓存策略:禁用

源请求策略

cookies_config {
    cookie_behavior = "all"
  }
  headers_config {
    header_behavior = "whitelist"
    headers {
      items = ["Host", "Accept-language]
    }
  }
  query_strings_config {
    query_string_behavior = "all"
  }

但问题是在网站的其中一个部分显示 HTML 而不是文本/设计。

预期结果

在此处输入图像描述

实际结果

在此处输入图像描述

I am using CloudFront with the following policies.

Cache Policy: Disable

Origin Request Policy:

cookies_config {
    cookie_behavior = "all"
  }
  headers_config {
    header_behavior = "whitelist"
    headers {
      items = ["Host", "Accept-language]
    }
  }
  query_strings_config {
    query_string_behavior = "all"
  }

But the problem is that in one of the section of website showing HTML instead of text/design.

Expected Result

enter image description here

Actual Result

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

芸娘子的小脾气 2025-01-22 10:24:52

问题出在 CloudFront 的原始请求策略中,缺少一些我无法找到特定的标头,因此将标头设置为 AllViwers,它显示了预期的结果。

原产地请求政策

cookies_config {
    cookie_behavior = "all"
}
headers_config {
    header_behavior = "allViewer"
}
query_strings_config {
    query_string_behavior = "all"
}

The issue was in the origin request policy of CloudFront, missing some header which I wasn't able to find specific, so putting header as AllViwers, it is showing the expected result.

Origin Request Policy

cookies_config {
    cookie_behavior = "all"
}
headers_config {
    header_behavior = "allViewer"
}
query_strings_config {
    query_string_behavior = "all"
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文