title: Serving static files with nginx on multiple machines and hard drives
body: <p>I have one project what will store large media content after it will be deployment. Project use Python, Django, also runned via Gunicorn and Supervisor.</p>
  
  <p>For static files I will use nginx.</p>
  
  <p>Basic setup I made by following <a href="http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/" rel="nofollow noreferrer">this article</a>, but I have an question, how can I store content more dynamicly. At the start I have one machine with 4 hard drives for 2Tb each, later will be buyed more, as well as the new machines <em>(currently I have only one)</em>.</p>
  
  <p>Site located as <code>site.com</code>, nginx located at subdomain <code>i.site.com</code> and have 2 folders in a root: <code>/static</code> for storing css, js, svg, e.t.c. design elements and <code>/media</code> what will be stored media content.</p>
  
  <p>The problem is setup nginx to write media on each hard drives and each machine will be used.</p>
  
  <p>For the speed I need to write every new file in a different hard drive (like rotation/loop), for example I saving <code>file1</code>, it writed at <code>machine1/hdd1</code>, then I saving <code>file2</code>, it writed at <code>machine1/hdd2</code>... <code>file4</code> at <code>machine1/hdd4</code>, <code>file5</code> at <code>machine2/hdd1</code> <em>(currently as I mentioned I have only one machine, but will be more in a future)</em>.</p>
  
  <p>So, anyone have expirience or idea how can I make that? I'm sure nginx can at least write at multiple hard drives, but I'm not sure what can I do if I need to write media data at multiple machines.
  If you also have any other idea, please suggest it as well.</p>
  
  <p>Example of nginx config you may find in mentioned article, or by following <a href="https://gist.github.com/postrational/5747293#file-hello-nginxconf" rel="nofollow noreferrer">this link</a>. I also looking for nginx <a href="https://nginx.org/en/docs/http/ngx_http_upstream_module.html" rel="nofollow noreferrer">upstream module</a>, but I not actually sure if I can configure that with it.</p>