- 
      
- 
        Save wisammechano/c1d3fd09afd9d61cab0bbc1e9dd2b00a to your computer and use it in GitHub Desktop. 
Revisions
- 
        Sebastian Kippe renamed this gist Nov 6, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewingFile renamed without changes.
- 
        Sebastian Kippe created this gist Nov 6, 2014 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ location ~* ^/s3/(.*) { set $bucket '<REPLACE WITH YOUR S3 BUCKET NAME>'; set $aws_access '<REPLACE WITH YOUR AWS ACCESS KEY>'; set $aws_secret '<REPLACE WITH YOUR AWS SECRET KEY>'; set $url_full "$1"; set_by_lua $now "return ngx.cookie_time(ngx.time())"; set $string_to_sign "$request_method\n\n\n\nx-amz-date:${now}\n/$bucket/$url_full"; set_hmac_sha1 $aws_signature $aws_secret $string_to_sign; set_encode_base64 $aws_signature $aws_signature; resolver 172.31.0.2 valid=300s; resolver_timeout 10s; proxy_http_version 1.1; proxy_set_header Host $bucket.s3.amazonaws.com; 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://s3.amazonaws.com; } 
 Sebastian Kippe
              renamed
            
            this gist
            
              Sebastian Kippe
              renamed
            
            this gist