anomalizer / ngx_aws_auth

nginx module to proxy to authenticated AWS services
BSD 2-Clause "Simplified" License
470 stars 144 forks source link

Signature Error when not using server's root location #8

Closed MafiaInc closed 9 years ago

MafiaInc commented 10 years ago

Hi,

I don't understand why I always get "SignatureDoesNotMatch" error from aws when trying to get object with specified location for example:

   location /storage {
        s3_bucket my_bucket;
        chop_prefix /storage;
        proxy_pass http://my_bucket.s3.amazonaws.com;

        aws_access_key my_access_key;
        aws_secret_key my_secret_key;

        proxy_set_header Authorization $s3_auth_token;
        proxy_set_header x-amz-date $aws_date;
    }

If I use / location and comment out the chop_prefix variable it's working good. Can you help here?

vickybiswas commented 10 years ago

Am having same Issue. Solved using a rewrite /test/([^/]+) /$1 break;

But Space in the url breaks that too

Any Solution?

vickybiswas commented 10 years ago

I got the solution.

Works for me Please confirm if it helped anyone else. Also if it does this should be included in the documentation Created a Pull

we have to use rewrite /test/(.+) /$1 break; and proxy_pass http://your_s3_bucket.s3.amazonaws.com/$1;