> ## Content Index
> Fetch the complete content index at: https://lucent.blog/llms.txt
> Use this file to discover other available public pages before exploring further.

# Python minio fget_object 等操作报错AccessDenied的问题
- URL: https://lucent.blog/xixadedw/
- Published: 2025-06-11T07:53:07.000Z
- Updated: 2026-08-21T00:49:54.000Z
- Author: Lucent

起因是发现 fget\_object 方法一直报AccessDenied,但是无论怎样排查 AK/SK都是权限正常的，并且在Java的框架中所有都是正常的。

然后直接尝试直接使用 ip:9000 连接，是正常使用的，所以问题出在了代理上。

我们使用nginx 反向代理了9000端口，看日志发现，所有HEAD请求都变成403了。

### 原因

**Nginx 或中间层缓存可能对** `HEAD` **请求返回旧的或篡改的响应**，最终触发：

```
S3Error: AccessDenied - Access denied
```

### 解决方法:

**在反向代理 location 块内**加入：

```
proxy_buffering off;
proxy_request_buffering off;
proxy_cache off;
add_header Cache-Control "no-cache, no-store, must-revalidate";
add_header Pragma "no-cache";
```