title: Correct setup for multiple web sites with nginx, django and celery
body: <p>Im trying to find some information on the correct way of setting up multiple django sites on a linode (Ubuntu 12.04.3 LTS (GNU/Linux 3.9.3-x86_64-linode33 x86_64)</p>
  
  <p>Here is what I have now:</p>
  
  <p>Webserver: nginx</p>
  
  <p>Every site is contained in a .virtualenv</p>
  
  <p>Django and other packages is installed using pip in each .virtualenv</p>
  
  <p>RabbitMQ is installed using <code>sudo apt-get rabbitmq</code>, and a new user and vhost is created for each site.</p>
  
  <p>Each site is started using supervisor script:</p>
  
  <pre><code>[group:&lt;SITENAME&gt;]
  programs=&lt;SITENAME&gt;-gunicorn, &lt;SITENAME&gt;-celeryd, &lt;SITENAME&gt;-celerycam
  
  
  [program:&lt;SITENAME&gt;-gunicorn]
  directory = /home/&lt;USER&gt;/.virtualenvs/&lt;SITENAME&gt;/&lt;PROJECT&gt;/
  command=/home/&lt;USER&gt;/.virtualenvs/&lt;SITENAME&gt;/bin/gunicorn &lt;PROJECT&gt;.wsgi:application -c /home/&lt;USER&gt;/.virtualenvs/&lt;SITENAME&gt;/&lt;PROJECT&gt;/server_conf/&lt;SITENAME&gt;-gunicorn.py
  
  user=&lt;USER&gt;
  autostart = true
  autorestart = true
  stderr_events_enabled = true
  redirect_stderr = true
  logfile_maxbytes=5MB
  
  
  [program:&lt;SITENAME&gt;-celeryd]
  directory=/home/&lt;USER&gt;/.virtualenvs/&lt;SITENAME&gt;/&lt;PROJECT&gt;/
  command=/home/&lt;USER&gt;/.virtualenvs/&lt;SITENAME&gt;/bin/python /home/&lt;USER&gt;/.virtualenvs/&lt;SITENAME&gt;/&lt;PROJECT&gt;/manage.py celery worker -E -n &lt;SITENAME&gt; --broker=amqp://&lt;SITENAME&gt;:&lt;SITENAME&gt;@localhost:5672//&lt;SITENAME&gt; --loglevel=ERROR
  environment=HOME='/home/&lt;USER&gt;/.virtualenvs/&lt;SITENAME&gt;/&lt;PROJECT&gt;/',DJANGO_SETTINGS_MODULE='&lt;PROJECT&gt;.settings.staging'
  
  user=&lt;USER&gt;
  autostart=true
  autorestart=true
  startsecs=10
  stopwaitsecs = 600
  
  [program:&lt;SITENAME&gt;-celerycam]
  directory=/home/&lt;USER&gt;/.virtualenvs/&lt;SITENAME&gt;/&lt;PROJECT&gt;/
  command=/home/&lt;USER&gt;/.virtualenvs/&lt;SITENAME&gt;/bin/python /home/&lt;USER&gt;/.virtualenvs/&lt;SITENAME&gt;/&lt;PROJECT&gt;/manage.py celerycam
  environment=HOME='/home/&lt;USER&gt;/.virtualenvs/&lt;SITENAME&gt;/&lt;PROJECT&gt;/',DJANGO_SETTINGS_MODULE='&lt;PROJECT&gt;.settings.staging'
  
  user=&lt;USER&gt;
  autostart=true
  autorestart=true
  startsecs=10
  </code></pre>
  
  <hr>
  
  <p>Question 1: Is this the correct way? Or is it a better way to do this?</p>
  
  <p>Question 2: I have tried to install <a href="https://github.com/mher/flower">celery flower</a>, but how does that work with multiple sites? Do I need to install one flower-package for each .virtualenv, or could I use one install for every site? How do I setup nginx to display the flower-page(s) on my server?</p>