Handle user uploads in static content server (newbie question)

Arvind Jayaprakash work at anomalizer.net
Mon Apr 12 21:07:24 MSD 2010


On Apr 12, Leonardo Crespo wrote:
>> (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...

 * D is also capable of serving the static files.
 * S has a proxy pass to D with the caching options turned on.
 * User traffic always refers to S and not D for the static content.

This way, S _pulls_ the file from D on a cache miss over HTTP.

I have been using this setup in production for a few months now. And it
works even in cases where D & S are in different continents.



More information about the nginx mailing list