aws-sdk-s3 访问搭建 minio 内文件的时候报错:
SignatureDoesNotMatch The request signature we calculated does not match the signature you provided. Check your key and signing method
先排查账号密码是否正确,无问题情况可能由以下问题引起
涉及到 minio 的签名认证,minio 在生成文件链接时候会根据 request header Host 生成签名,在大部分场景下,如:nginx,BLB 等组件下,如果没有将 header Host 放置到转发的规则内,minio 接收到了 nginx 或者 BLB 等内的 Host,就会抛出访问签名失败的错误。
nginx 增加方法
location / {
# $http_host -> minio:30000
proxy_set_header Host $http_host;
proxy_pass http://minio:30000;
}