set-misc-nginx-module icon indicating copy to clipboard operation
set-misc-nginx-module copied to clipboard

Using NGINX as S3 Proxy for minio?

Open ghost opened this issue 6 years ago • 0 comments

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.

ghost avatar Aug 29 '19 08:08 ghost