# Nginx as proxy for Amazon S3 protected files

**URL:** <https://www.ruby-forum.com/t/nginx-as-proxy-for-amazon-s3-protected-files/180325>\
**Category:** NGINX\
**Created:** [December 17, 2009, 2:35pm UTC](https://www.ruby-forum.com/t/nginx-as-proxy-for-amazon-s3-protected-files/180325 "2009-12-17T14:35:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Smrchy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/51bf81/32.png) [@Smrchy](https://www.ruby-forum.com/u/Smrchy)\
**Post date:** [December 17, 2009, 2:35pm UTC](https://www.ruby-forum.com/t/nginx-as-proxy-for-amazon-s3-protected-files/180325/1 "2009-12-17T14:35:32Z")

</div>

Hi everyone,  
i know Nginx could make for an excellent proxy for Amazon S3 files when  
there are publicly accessible.

Did anyone ever setup Nginx to proxy files where the ACL ist set to  
“authenticated-read”?

Nginx would have to generate signed URLs with the access key and expiry  
date  
for each request.

---

<div class="post-metadata">

**Author:** ![Smrchy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/51bf81/32.png) [@Smrchy](https://www.ruby-forum.com/u/Smrchy)\
**Post date:** [December 19, 2009, 3:25pm UTC](https://www.ruby-forum.com/t/nginx-as-proxy-for-amazon-s3-protected-files/180325/2 "2009-12-19T15:25:42Z")

</div>

Hello!

On Thu, Dec 17, 2009 at 02:31:05PM +0100, Smrchy wrote:

> Hi everyone,  
> i know Nginx could make for an excellent proxy for Amazon S3 files when  
> there are publicly accessible.
> 
> Did anyone ever setup Nginx to proxy files where the ACL ist set to  
> “authenticated-read”?
> 
> Nginx would have to generate signed URLs with the access key and expiry date  
> for each request.

I believe at least someone did, try searching mailing list  
archives. You probably need embedded perl to construct correctly  
signed URLs though.

Maxim D.

---

<div class="post-metadata">

**Author:** ![Smrchy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/51bf81/32.png) [@Smrchy](https://www.ruby-forum.com/u/Smrchy)\
**Post date:** [January 28, 2010, 9:54am UTC](https://www.ruby-forum.com/t/nginx-as-proxy-for-amazon-s3-protected-files/180325/3 "2010-01-28T09:54:53Z")

</div>

Hi

> archives. You probably need embedded perl to construct correctly  
> signed URLs though.

I also need nginx to authenticate against S3. Have been looking through  
the list and on Google but couldn’t find anything.

Anyone has a link to such a project, if it exists? Else I’m gonna start  
looking into it.

Thanks in advance

Regards

---

<div class="post-metadata">

**Author:** ![Smrchy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/51bf81/32.png) [@Smrchy](https://www.ruby-forum.com/u/Smrchy)\
**Post date:** [February 10, 2010, 8:05am UTC](https://www.ruby-forum.com/t/nginx-as-proxy-for-amazon-s3-protected-files/180325/4 "2010-02-10T08:05:21Z")

</div>

Hello,

I found there’s an apache module for S3 auth. Maybe it’s possible to  
import it in nginx (with light modifications) ?  
Here’s the link :  
[http://cpansearch.perl.org/src/IWADE/Apache2-S3-0.05/lib/Apache2/S3.pm](http://cpansearch.perl.org/src/IWADE/Apache2-S3-0.05/lib/Apache2/S3.pm)

As far as I can see (not an expert, far of it!), one has only to change  
“apache2” with “nginx”, and maybe some var names…

As we also need this kind of stuff, it would be really great if a module  
was done. Maybe if I have some time I can _try_ to do it, but I’m  
affraid it will not be before months ☹

Best regards,

C.

On Thu, 28 Jan 2010 09:54:20 +0100
