Search code examples
nginxnginx-reverse-proxynginx-ingressminiopre-signed-url

Nginx reverse proxy for minio presigned url throwing SignatureDoesNotMatch error


minio is running on url: abc.example.com:9000
For application we have xyz.example.com,
I want to reverse proxy the minio presigned URL with application url (xyzminio.example.com/presigned_url).

server {
  listen 80;
  server_name xyzminio.example.com;

  location / {
    proxy_pass https://abc.example.com:9000;
    #proxy_pass_request_headers off;        
    proxy_set_header Host $http_host;        
    #proxy_set_header Host $host;
    proxy_buffering off;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;        
    #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
  }
}

But I'm getting below exception with 403 error code

<Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>

Solution

  • After few trial and error below configuration worked:

    server {
      listen 80;
      server_name xyzminio.example.com;
    
      location / {
        proxy_pass https://abc.example.com:9000;
        proxy_pass_request_headers off;
       }
      }