is this possible?

Adam Michaels adam at digitalagemedia.net
Sat Oct 20 12:56:43 MSD 2007


I had a similar question to using nginx with Amazon's S3. Is it possible for 
nginx to look in its local cache for an image, if its not there, grab it 
from S3, and cache it before sending it to the user under my domain instead 
of S3's?

Thanks.

----- Original Message ----- 
From: "Igor Sysoev" <is at rambler-co.ru>
To: <nginx at sysoev.ru>
Sent: Saturday, October 20, 2007 4:40 AM
Subject: Re: is this possible?


> On Fri, Oct 19, 2007 at 09:19:21PM -0700, Ben Marklein wrote:
>
>> I'm relatively new to nginx and I'm trying to figure
>> out whether it's suitable for a specific use I have.
>> I'd like to set up the following for serving a high
>> volume of "badge" images in a lazy mannger.  These are
>> images that are customized per-user, for use on social
>> network site profile pages.  Can someone tell me if
>> this will be possible using nginx?
>>
>> 1) Request for /badge/username.jpg comes into nginx.
>> It proxies(?) to S3 using a standardized scheme.
>> 2) If the image is present it's passed back via nginx.
>>  If not, we get a 404.  nginx then proxies to a Rails
>> app that generates the image on the fly, and kicks off
>> a background task to upload the image to S3 so that.
>>
>> If someone could tell me whether this is possible and
>> ideally provide some configuration pseudocode I would
>> be very grateful.  Thanks!
>
> S3 - is it Amazon S3 ?
>
>    location  /badge/ {
>        proxy_pass   http://...S3...
>
>        proxy_intercept_errors  on;
>        error_page    404  =  @rails;
>    }
>
>    location  @rails {
>        proxy_pass   http://rails;
>    }
>
>
> -- 
> Igor Sysoev
> http://sysoev.ru/en/
>
>
> 






More information about the nginx mailing list