Changes between Version 36 and Version 37 of ServerArrangements


Ignore:
Timestamp:
11/28/2007 08:46:45 PM (7 years ago)
Author:
Brandon Mercer <yourcomputerpal@…>
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ServerArrangements

    v36 v37  
    5656 * See [http://www.rkblog.rk.edu.pl/w/p/django-nginx/ Django on nginx] and [http://www.alrond.com/en/2007/mar/01/start-django-with-nginx/ Start Django with nginx].
    5757
     58I've been serving up my django site via nginx for a short while now and wanted to report my setup so that others may give it a shot.  My performance over the previous setup with lighttpd is a bit better.  This setup uses much less cpu and memory to achieve much better throughput and response time.  The simple syntax of the nginx.conf allows you to setup a cluster of backend processes quite easily to handle load.  Currently this is my nginx.conf relevant to my django site.  You can reference the above links for more information about additional options. 
     59
     60{{{
     61
     62upstream djangoserv {
     63server 127.0.0.1:8801;
     64}
     65
     66server {
     67listen 80;
     68root /path/to/app;
     69server_name test.local.domain;
     70access_log /path/to/logs/appname-access.log main;
     71error_log /path/to/logs/appname-error.log;
     72
     73location / {
     74                        # host and port to fastcgi server
     75                        fastcgi_pass 127.0.0.1:8801;
     76                        fastcgi_param PATH_INFO $fastcgi_script_name;
     77                        fastcgi_param REQUEST_METHOD $request_method;
     78                        fastcgi_param QUERY_STRING $query_string;
     79                        fastcgi_param SERVER_NAME $server_name;
     80                        fastcgi_param SERVER_PORT $server_port;
     81                        fastcgi_param SERVER_PROTOCOL $server_protocol;
     82                        fastcgi_param CONTENT_TYPE $content_type;
     83                        fastcgi_param CONTENT_LENGTH $content_length;
     84                        fastcgi_pass_header Authorization;
     85                        fastcgi_intercept_errors off;
     86}
     87}
     88
     89}}}
     90
     91Once you fire up nginx you will need to start your nginx fastcgi processes.  I simply use:
     92
     93{{{
     94
     95python2.4 manage.py runfcgi method=threaded host=127.0.0.1 port=8801
     96
     97}}}
     98
    5899== Django behind/inside Zope ==
    59100
Back to Top