Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using NGINX as S3 Proxy for minio? #54

Open
ghost opened this issue Aug 29, 2019 · 0 comments
Open

Using NGINX as S3 Proxy for minio? #54

ghost opened this issue Aug 29, 2019 · 0 comments

Comments

@ghost
Copy link

ghost commented Aug 29, 2019

is maybe someone here that has done a NGINX config to proxy S3 requests from minio with proper authentification using NGINX with lua and misc module? e.g. Something like this:

location /media  {
            set $bucket           'media';
            set $aws_access       'AKIAIOSFODNN7EXAMPLE';
            set $aws_secret       'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY';
            set $url_full         "$1";
            set $aws_signature    '';
            set_by_lua $now       "return ngx.http_time(ngx.time())";
            set $string_to_sign   "$request_method\n\n\n\nx-amz-date:${now}\n/$url_full/$bucket";
            set_hmac_sha1          $aws_signature $aws_secret $string_to_sign;
            set_encode_base64      $aws_signature $aws_signature;
            resolver_timeout       10s;
            proxy_http_version     1.1;
            proxy_set_header       x-amz-date $now;
            proxy_set_header       Authorization "AWS $aws_access:$aws_signature";
            proxy_buffering        off;
            proxy_intercept_errors on;
            rewrite .* /$url_full break;
            proxy_pass             http://backend-data;
            proxy_set_header       Host $http_host;
            add_header X-Content-Type-Options nosniff;

Currently there is no clean implementation for django 2.x to communicate with minio or at least i was not able to make those working and i tried a lot of the available plug-ins according to that proplem. Currently my methode shown above returns the following error: "The request signature we calculated does not match the signature you provided. Check your key and signing method." Any idea on that? to me it seems that i put the string together correctly

Thanksful for any help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants