OnceMi.AspNetCore.OSS icon indicating copy to clipboard operation
OnceMi.AspNetCore.OSS copied to clipboard

Minio Nginx反向代理后调用异常:MinIO API responded with message=Access denied on the resource: *******/

Open withsalt opened this issue 3 years ago • 1 comments

异常:
调用BucketExistsObjectsExists等接口时会抛出异常:MinIO API responded with message=Access denied on the resource: *******/

复现步奏:

  1. Minio配置https
  2. Minio通过nginx反向代理,实现用域名(比如:https://oss.oncemi.com)访问minio。
  3. 调用上述有问题接口中的其中一个

目前解决方案:
BucketOperations文件中方法BucketExistsAsync

RestRequest request = await this.CreateRequest(Method.HEAD, args.BucketName).ConfigureAwait(false);

修改为:

RestRequest request = await this.CreateRequest(Method.Get, args.BucketName).ConfigureAwait(false);

但是为了与官方SDK保持一致(Java也是HEAD方式请求),在本SDK中并没有作出修改。

withsalt avatar Aug 07 '21 10:08 withsalt