minio访问链接配置域名代理后文件无法访问,页面提示SignatureDoesNotMatch,The request signature we calculated does not match。
·
问题背景:
minio的部署地址和图片链接访问地址原ip格式,在图片前加一层域名代理后访问报以下信息

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
<Key>237d2257e7b5412aacf17a4993619e2d.png</Key>
<BucketName>project</BucketName>
<Resource>/project/237d2257e7b5412aacf17a4993619e2d.png</Resource>
<RequestId>18794AC4AC97106A</RequestId
<HostId>dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8</HostId>
</Error>
原因分析:
提示:这个错误的根本原因是MinIO 生成预签名 URL 时使用的 Host 与代理传递的 Host 不一致。
当您访问 MinIO 生成的预签名 URL 时:
1、MinIO 在生成签名时会使用请求的 Host 信息
2、通过代理访问时,如果代理配置的 Host 与生成签名时的 Host 不一致
3、MinIO 在验证签名时会发现不匹配,从而返回 SignatureDoesNotMatch 错误
解决方案:
提示:配置域名代理时,固定Host的地址为minio实际部署的endpoint.
原来设置:

解决方式:修改Host地址$http_host设置为minio部署实际ip端口
分析:处理前,f12查看文件访问请求,host信息是配置代理后的域名地址,而不是实际minio部署的ip地址,minio有host校验机制,会拦截这种情况。
更多推荐


所有评论(0)