minio

minio: Unsupported header for CORS configuration


I am trying to set CORS config for a bucket in minio. This is content of cors.xml

<CORSConfiguration>
  <CORSRule>
    <AllowedOrigin>*</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
    <AllowedMethod>POST</AllowedMethod>
    <AllowedMethod>PUT</AllowedMethod>
    <AllowedHeader>*</AllowedHeader>
    <ExposeHeader>x-amz-request-id</ExposeHeader>
    <ExposeHeader>x-amz-id-2</ExposeHeader>
    <MaxAgeSeconds>3000</MaxAgeSeconds>
  </CORSRule>
</CORSConfiguration>

When I run:

mc cors set myminio/mybucket <path to cors.xml file>

I get error

mc: <ERROR> Unable to set bucket CORS configuration for myminio/mybucket. A header you provided implies functionality that is not implemented.

It doesn't tell which header is not supported.

mc version:

mc version RELEASE.2024-10-29T15-34-59Z (commit-id=9f4659884dd45dca726ba38ee6bfacb2bf776eb8)
Runtime: go1.22.7 windows/amd64
Copyright (c) 2015-2024 MinIO, Inc.
License GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html

Any lead?


Solution

  • I was also trying to configure cors on bucket level, but kept giving me same error as you're getting. Digging a little into the minio's repository, I found a thread by devs which mentions that,

    Bucket CORS is only supported in the AIStor version of MinIO which requires a paid subscription. Please see min.io/pricing.

    Since I am using minio's free version, I came to the conclusion that it cannot be configured on bucket level.

    I know you didn't ask, but, what worked for me was the ngnix reverse proxy configuration. Meaning that I already have minio working through ngnix, and I just configured cors for the minio's API rather than on a specific bucket.

    Link to github thread