我创建了一个AWS CloudFront发行版,以尝试通过CloudFront向fonts.googleapis.com代理请求。因此,例如,我想使用以下列表:
https://xxxxxx.cloudfront.net/css2?family=noto+sans+hk:wght@400; 500; 700; 700 ;900 ;900&ampplay=swap
以获取fetth来自原点的实际内容:
https://fonts.googleapis.com/css2?family=
noto++sans+hk:wght@400上.googleapis.com“并设置它,以使其通过所有URL参数,但是原始问题仍然响应:
404. That’s an error.
The requested URL /css2 was not found on this server.
有人知道可能导致这一点吗? Afaik,我配置的CloudFront的方式应该像透明的通行证一样。
我不能在这里共享所有云沿配置设置(太多),但是也许有人可以将我指向正确的方向?
还是不可能?
I have created an AWS Cloudfront distribution in an attempt to proxy requests to fonts.googleapis.com through Cloudfront. So for example, I'd like to use something list this:
https://xxxxxx.cloudfront.net/css2?family=Noto+Sans+HK:wght@400;500;700;900&display=swap
To fetch the actual content from the origin at:
https://fonts.googleapis.com/css2?family=Noto+Sans+HK:wght@400;500;700;900&display=swap
I have configured Cloudfront with an origin of "fonts.googleapis.com" and set it so that it passes through all URL parameters, but still the origin responds with:
404. That’s an error.
The requested URL /css2 was not found on this server.
Does anyone know what could be causing this? Afaik, the way I've configured Cloudfront should act like a transparent pass-through.
I can't share all of the Cloudfront config settings here (there are too many), but perhaps someone can point me in the right direction?
Or is this impossible?
发布评论
评论(2)
实际上,这确实很好。我刚刚设置了云的分布。
This in fact did work fine. I had just setup the CloudFront distribution incorrectly.
我怀疑所指的更改是要更新行为,以防止原点请求发送主机标头。创建一个缓存策略,从原始请求中删除主机标头,一切都会为您神奇起作用。
I suspect the change OP referred to was to update the behavior to prevent the origin request from sending the host header. Create a cache policy, remove the host header from the origin request and everything will work magically for you.