Handle user uploads in static content server (newbie question)

Leonardo Crespo leo at leocrespo.com
Mon Apr 12 06:33:36 MSD 2010

On Mon, Apr 12, 2010 at 12:17 PM, Arvind Jayaprakash
<work at anomalizer.net> wrote:
> On Apr 12, Leonardo Crespo wrote:
>>To make it simpler, here's a scenario:
>>Server A is static.domain.com ip servers ALL static
>>content (jpegs, gifs, pngs, mp3s etc... including user uploaded
>>content like photo albums)
>>Server B is www.domain.com ip servers DYNAMIC content, php files.
>>If user submits a jpg to his photo album, it'll get uploaded to B, as
>>page's going to run on server B because it's a .php file (upload.php).
>>How can the image possibly be served from server A without
>>synchronization issues?
> You options are:
> (1) Shared filesystem between the two hosts to hold the static content

They're different linodes so I don't think this is an option.

> (2) Use nginx with caching proxy on the static machine
> In this setup, a cache miss will result in a request for the static
> resource from the dynamic server (which I assume is also capable of
> serving static content). This should work as long you expect to have a
> high cache hit ratio

So user uploads a file to Dynamic Server (D). All request to static
files are served from Static Server (S). If a file is not found on
(S), cache miss, serve the file from (D). Correct? In this scenario,
how would the file ever get served from the Static Server (S)?
Something has to copy the files from server D to S...

> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx

More information about the nginx mailing list