1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
# inside a http section
# replace the several paths and names
server {
listen 80;
server_name servername;
access_log /path/to/log/file;
location /media {
root /path/to/sites/siteYY/;
# I use a symbolic link called "admin" in the media/ folder
# (pointing to /usr/local/lib/python2.6/dist-packages/django/contrib/admin/media/ in my case)
# as suggested in http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#serving-the-admin-files
# so that nginx serves the django admin media files with the parameter
# ADMIN_MEDIA_PREFIX set to '/media/admin/' in settings.py
}
location / {
fastcgi_pass unix:RUNFILES_PATH/siteYY.socket;
# for a TCP host/port:
# fastcgi_pass {hostname}:{port};
# necessary parameter
fastcgi_param PATH_INFO $fastcgi_script_name;
# to deal with POST requests
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
# http://stackoverflow.com/questions/605173/how-to-nginx-virtual-servers-fcgi-for-django uses many other parameters,
# some may be necessary in some situations
}
}
|