Search code examples
amazon-web-servicesamazon-s3cloudaws-sdkminio

Any way to configure what signature version a Minio server accepts?


I have a Minio server set up and everything appears to be running normally.

For my CLI, I have this in my config.json:

    "myalias": {
        "url": "https://myurl",
        "accessKey": "myaccesskey",
        "secretKey": "mysecretkey",
        "api": "S3v4",
        "lookup": "auto",
        "Region": "us-east-1"
    }

But when I try to upload a file, I get this:

# mc cp test.txt myalias/stuff/
 0 B / 19 B [                                                       ]  0.00% 
mc: <ERROR> Failed to copy `test.txt`. The request signature we 
calculated does not match the signature you provided. Check your key and 
signing method.

If I change my api in config.json to this:

"api": "S3v2"

It works:

# mc cp test.txt myalias/stuff/
test.txt:    19 B / 19 B [==============================] 100.00% 193 B/s 0s

My question is, can I configure Minio to use version 4 signature verification instead of version 2? Isn't minio supposed to use version 4 by default?


Solution

  • Turns out it was a problem with NGINX that our IT guys had set up. The problem and solution are outlined in these links:

    https://github.com/minio/minio/issues/5298

    https://docs.minio.io/docs/setup-nginx-proxy-with-minio

    tl;dr:

    After hours of research, I realized that I missed the Host directive on both reverse proxy configurations I had set.

    For completeness, I missed those ones:

    Nginx

    location / {
        proxy_set_header Host            $host;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_pass http://minio;
    }
    

    Caddyfile

    proxy / localhost:9898 {
          transparent
    }