Actually, for anything that resembles production environment, I'd recommend using uWSGI in Emperor mode[1] to manage its instance than using Supervisor. Emperor mode will gracefully reload the app if config file's modification time changed (via `touch`) or stop and start the process automatically if you remove or add a configuration file.
My setup usually uses Upstart[2] (Ubuntu) or init script (Debian, etc.) to run uWSGI Emperor and make it scan /etc/uwsgi. When I need to deploy a new version, I just push the code then `touch /etc/uwsgi/myapp.ini` and my app is live with the code I just pushed.
[1] http://uwsgi-docs.readthedocs.org/en/latest/Emperor.html
[2] http://uwsgi-docs.readthedocs.org/en/latest/Upstart.html
uwsgi protocol is built-in in nginx >= 0.8.40; for older versions (and a general walkthrough), see http://uwsgi-docs.readthedocs.org/en/latest/Nginx.html
Here's the relevant bit for nginx's .conf:
(I would advise the former for performance reasons (unix sockets are faster)) Here are my nginx relevant directives - in server {} scope, Then (still in server {} scope), That's it! That way I can reuse $uwsgi_socket as many times as is needed, etc.The most simple way to launch the uWSGI app server would be to e.g.
So we add a parent directory ("lba" containing the actual application files, e.g. __init__.py (can be empty) so that the directory could be imported (lba:app in uWSGI launch), etc.), tell uWSGI that this is to be the parent uwsgi process (-M), point it to its socket (-s), set number or processes (-p), tell it to actually load our 'WSGI module' (-w), and supply other per-application parameters which are not necessary if you just want to test things out.app.py (lba:app) may simply contain (from http://flask.pocoo.org/docs/quickstart/) e.g.
That way you can test the sample app by simply sudo service nginx reload and ./test.sh (you might need sudo for the latter, too; also, might need to touch ../var/uwsgi.sock and look into uwsgi --help | grep "user") You can then put the test.sh (or the uwsgi call line itself) into e.g. supervisor - if the user privilege nuances are sorted out, you more or less have a production-worth setup (as far as nginx <-> uwsgi <-> your app is concerned), methinks.edit sirn and antihero make a good point about Emperor mode