gpt4 book ai didi

amazon-web-services - AWS CloudFront : Font from origin has been blocked from loading by Cross-Origin Resource Sharing policy

转载 作者:行者123 更新时间:2023-12-03 04:20:21 26 4
gpt4 key购买 nike

我在几个(但不是全部)Chrome 浏览器上收到以下错误。目前还不完全确定问题是什么。

Font from origin https://ABCDEFG.cloudfront.net has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin https://sub.domain.example is therefore not allowed access.

我在 S3 上有以下 CORS 配置

<CORSConfiguration>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedHeader>*</AllowedHeader>
<AllowedMethod>GET</AllowedMethod>
</CORSRule>
</CORSConfiguration>

请求

Remote Address:1.2.3.4:443
Request URL:https://abcdefg.cloudfront.net/folder/path/icons-f10eba064933db447695cf85b06f7df3.woff
Request Method:GET
Status Code:200 OK
Request Headers
Accept:*/*
Accept-Encoding:gzip,deflate
Accept-Language:en-US,en;q=0.8
Cache-Control:no-cache
Connection:keep-alive
Host:abcdefg.cloudfront.net
Origin:https://sub.domain.example
Pragma:no-cache
Referer:https://abcdefg.cloudfront.net/folder/path/icons-e283e9c896b17f5fb5717f7c9f6b05eb.css
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36

来自 Cloudfront/S3 的所有其他请求均正常工作,包括 JS 文件。

最佳答案

将此规则添加到您的 .htaccess

Header add Access-Control-Allow-Origin "*"

更好的是,按照@david thomas的建议,您可以使用特定的域值,例如

Header add Access-Control-Allow-Origin "your-domain.example"

关于amazon-web-services - AWS CloudFront : Font from origin has been blocked from loading by Cross-Origin Resource Sharing policy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25577981/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com