News for hackers. Stuff that matters.
Re:How to configure nginx and uWSGI to serve Django projects by Ixiaus on Tuesday January 17, 2012 @12:02PM (#3475490)
nginx, Varnish, and uWSGI are oh so awesome together. My app (I run a Pyramid based application) is lightning fast, and very easy to configure (much easier than mod_wsgi).
Re:How to configure nginx and uWSGI to serve Django projects by gardentheory on Tuesday January 17, 2012 @12:44PM (#3475669)
Why nginx AND varnish? I thought varnish could proxy as well? Or maybe could you explain your setup.
Re:How to configure nginx and uWSGI to serve Django projects by mrweasel on Tuesday January 17, 2012 @12:52PM (#3475705)
Varnish is just a proxy, or webcache, as I believe they like to call it. Nginx is needed because Varnish won't talk directly to the uwsgi processes, Varnish only understands http. The data that Varnish need to cache has to be supplied by a webserver somewhere and nginx is pretty nice and easily configurable. So I would assume that the idea is to use nginx as the webserver, not the cache/proxy.
Re:How to configure nginx and uWSGI to serve Django projects by unbit on Tuesday January 17, 2012 @01:00PM (#3475743)
you can directly link uWSGI with varnish using http protocol instead of the uwsgi one: http://projects.unbit.it/uwsgi/wiki/Example#varnish
Re:How to configure nginx and uWSGI to serve Django projects by mrweasel on Tuesday January 17, 2012 @05:17PM (#3476750)
I did not know that... That's pretty awesome.
Re:How to configure nginx and uWSGI to serve Django projects by acdha on Tuesday January 17, 2012 @07:04PM (#3477145)
nginx is a much weaker proxy and doesn't allow as much customization as Varnish does. A coworker also ran into some basic HTTP compliance issues with nginx's cache and Vary headers - IIRC it simply ignores them outright. If you need more than very basic caching it's usually better to use Varnish because it's obsessively focused on doing that job well.

Depending on how you choose to implement it, this may also result in cleaner architecture if you have Varnish as a simple HTTP brick with little knowledge of the backend implementation, leaving all of the gory details to nginx.

Re:How to configure nginx and uWSGI to serve Django projects by Ixiaus on Wednesday January 18, 2012 @11:18AM (#3480410)
I basically use nginx the way people would use Apache and Varnish I use as a webcache. Others have explained it thoroughly.