问题描述
使用nginx配置minio的路径,显示403 错误
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied.</Message>
<Key>08/11/0d9c3ac857534894b7e3111214f8b1d3时频图.png</Key>
<BucketName>2024</BucketName>
<Resource>/2024/08/11/0d9c3ac857534894b7e3111214f8b1d3时频图.png</Resource>
<RequestId>17EA97426EB62BB6</RequestId>
<HostId>9917763d-ce22-4997-a944-1e61703bb327</HostId>
</Error>
解决方案
查看了很多配置,都是无效的。最后发现问题点:proxy_pass配置最后不能带/
。
如下:
location /xxx/ {
proxy_pass http://192.xxx.x.xxx:9000;
proxy_set_header Host $host;
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;
}