作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已将 MinIO 存储桶的访问权限设置为“下载”,以便任何人都可以读取(但不能写入)文件,但这启用了显示整个存储桶内容的“索引页面”。例如,考虑包含文件 example.png
的存储桶 store/test
。我希望 example.png
可以被万维网读取,所以我将 store/test
的访问权限设置为“下载”,这意味着 https://store.example.com/test/example.png现在任何人都可以阅读,但这也意味着 https://store.example.com/test现在显示存储桶中所有文件的列表:
<!-- Pretty printed result of $ curl https://store.example.com/test -->
<?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Name>test</Name>
<Prefix/>
<Marker/>
<MaxKeys>4500</MaxKeys>
<Delimiter/>
<IsTruncated>false</IsTruncated>
<Contents>
<Key>example.png</Key>
<LastModified>2021-02-05T08:13:06.683Z</LastModified>
<ETag>"7c8b827ef97e929258e9728cb96059cf-33"</ETag>
<Size>4295413012</Size>
<Owner>
<ID>02d6176db174dc93cb1b899f7c6078f08654445fe8cf1b6ce98d8855f66bdbf4</ID>
<DisplayName/>
</Owner>
<StorageClass>STANDARD</StorageClass>
</Contents>
</ListBucketResult>
我不想显示此列表页面,但我确实希望存储桶中的所有文件都是世界可读的,包括稍后添加到存储桶中的文件。如何实现?
最佳答案
如果我的桶名是file
mc policy set none myminio/file
mc policy set download myminio/file/*
关于minio - 有没有办法隐藏 MinIO 存储桶的文件列表索引页?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66060035/
我是一名优秀的程序员,十分优秀!