MinIO与Nginx集成时,如果出现"Access Denied"错误,通常意味着Nginx代理的请求没有被正确地转发到MinIO服务。
出现错误:
<Error>
<Code>AccessDeniedCode>
<Message>Access Denied.Message>
<Key>test/1.jpgKey>
<BucketName>test1BucketName>
<Resource>/test1/test/1.jpgResource>
<RequestId>17C8FCF0E2325480RequestId>
<HostId>1379dddc-2b73-49e7-b13d-a8a937600002HostId>
Error>
解决方法:
server {
listen 80;
server_name localhost;
location /桶命名/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_connect_timeout 300;
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
proxy_http_version 1.1;
proxy_set_header Connection "";
chunked_transfer_encoding off;
#MinIO访问地址
proxy_pass http://localhost:9000;
}
}