What is the best method deploying Python (including Django) behind Nginx?
The official django documentation says that apache and mod_wsgi is the recommended way to get django into production.
We use nginx to proxy through to apache running mod_wsgi to serve our django site. We have apache listening on
127.0.0.1 and use
proxy_pass to pass requests to Apache. The nginx wiki has a bunch of examples.
I've also heard good things about gunicorn. (and you would still use
proxy_pass in nginx)
I use FastCGI for this on one of my sites (it's built on Django), both nginx and Django can do FastCGI natively. Addition: I have stress tested various approaches: nginx w/FastCGI, nginx w/Apache and then FastCGI, nginx w/Apache and then mod_wsgi and even nginx w/Apache and then mod_python. Performance was pretty much the same for a real application, so I chose nginx w/FastCGI without Apache to save RAM a bit.