Skip to content

Instantly share code, notes, and snippets.

@ruckus ruckus/gist:5819398
Created Jun 20, 2013

What would you like to do?
nginx: proxy files from S3. Let's masking the URL by pass Expires timestamp as e and Signature as st. For instance the basis URL is Source:
location ~* ^/proxy_private_file/(.*) {
set $s3_bucket '';
set $aws_access_key 'AWSAccessKeyId=YOUR_ONLY_ACCESS_KEY';
set $url_expires 'Expires=$arg_e';
set $url_signature 'Signature=$arg_st';
set $url_full '$1?$aws_access_key&$url_expires&$url_signature';
proxy_http_version 1.1;
proxy_set_header Host $s3_bucket;
proxy_set_header Authorization '';
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;
proxy_ignore_headers "Set-Cookie";
proxy_buffering off;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.