# Uploads & nginx/mongrel with multiple machine deployment

**URL:** <https://www.ruby-forum.com/t/uploads-nginx-mongrel-with-multiple-machine-deployment/140916>\
**Category:** Rails\
**Created:** [June 19, 2008, 8:15pm UTC](https://www.ruby-forum.com/t/uploads-nginx-mongrel-with-multiple-machine-deployment/140916 "2008-06-19T20:15:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![s0nspark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f475e1/32.png) [@s0nspark](https://www.ruby-forum.com/u/s0nspark)\
**Post date:** [June 19, 2008, 8:15pm UTC](https://www.ruby-forum.com/t/uploads-nginx-mongrel-with-multiple-machine-deployment/140916/1 "2008-06-19T20:15:34Z")

</div>

I am in the process of migrating an app that currently resides on a  
single hardware server (running pound, nginx as an asset host,  
memcached, mongrel and mysql) to a group of xen virtual machines: an  
appserver running the mongrels, a webserver running nginx (which will be  
handling the proxying now as well) and memcached, and a database server  
running mysql.

One of the apps I am moving handles file uploads and I am not clear on  
what impact splitting the web and app roles across servers will have.

I realize I will need to devise some method for making the uploaded file  
accessible to the web server after post-processing (since I want it  
serving all static content) but I am a bit confused about the actual  
upload submission.

To the point, I am not clear if nginx is actually receives the uploaded  
file and then hands it to the rails backend or if the rails backend  
handles the file upload all by itself… If that is the case would I  
need to also devise a way to make the file data accessible to the rails  
backend since it would seemingly reside on a different server?

I think I am thinking myself in knots. 🙂 Could someone clarify this  
for me?

---

<div class="post-metadata">

**Author:** ![s0nspark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f475e1/32.png) [@s0nspark](https://www.ruby-forum.com/u/s0nspark)\
**Post date:** [June 19, 2008, 9:10pm UTC](https://www.ruby-forum.com/t/uploads-nginx-mongrel-with-multiple-machine-deployment/140916/2 "2008-06-19T21:10:11Z")

</div>

nginx does buffer the whole request body before sending it to the  
backends. For the file distribution maybe attachment\_fu and S3? or  
NFS …
