Handle user uploads in static content server (newbie question)
Leonardo Crespo
leo at leocrespo.com
Mon Apr 12 06:37:39 MSD 2010
> location /uploads/ {
> proxy_pass http://10.1.1.2/uploads/ # or whatever
> }
So the code above is in the .conf file of the Dynamic server and
10.1.1.2 is the Static server's IP, correct?
I don't see how this can work still. If a file is Posted to
upload.php, it'll end up on Dynamic server and not on Static.
On Mon, Apr 12, 2010 at 12:18 PM, Gabriel Evans <me at gabevans.com> wrote:
> Just like you configure a proxy to your backend server, you can have a
> separate directory for uploaded files served through a proxy. There should
> be no need to sync files between the two servers.
>
> For example:
> location /uploads/ {
> proxy_pass http://10.1.1.2/uploads/ # or whatever
> }
>
> On Sun, Apr 11, 2010 at 5:58 PM, Leonardo Crespo <leo at leocrespo.com> wrote:
>>
>> Hi guys.
>>
>> Newbie question here, apologies in advance.
>>
>> By using a static content server (nginx as reverse proxy), how does
>> one deal with user uploads? I mean, I can understand if I client
>> request our website’s /images/logo.png file, because we manually store
>> it on the static content server, but what about the photo that our
>> user just uploaded to his photo album?
>>
>> My confusion is: if a request is to a .php file, I’ll pass through the
>> back-end server. So If a user wants to upload a file, it’ll be upload
>> to /user-uploads/file.jpg *on the back-end server*. How can we make
>> the static server serve the image? I’m imagining there has to be some
>> sort of synchronization, but then again there the problem that the
>> image might take longer to be replicated to the static content server
>> and when the user request’s it, he’ll get a 404… not acceptable for
>> online businesses.
>>
>> Can anyone with more experience tell me what am I missing?
>>
>> Cheers
>>
>> Leonardo
>>
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://nginx.org/mailman/listinfo/nginx
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
>
More information about the nginx
mailing list