upstream django { server unix:///var/log/dangann/dangann.sock; # for a file socket }
server { # the port your site will be served on listen 80; # the domain name it will serve for server_name dangann.com; # substitute your machine's IP address or FQDN charset utf-8;
# Django media location /media { alias /root/dangann/media; # your Django project's media files - amend as required }
location /static { alias /root/dangann/static; # your Django project's static files - amend as required }
# Finally, send all non-media requests to the Django server. location / { uwsgi_pass django; include /root/dangann/conf/production/uwsgi_params; # the uwsgi_params file you installed } }
# Django-related settings # the base directory (full path) chdir = /root/dangann/ # Django's wsgi file module = dangann.wsgi
# process-related settings # master master = true # maximum number of worker processes processes = 4 # the socket (use the full path to be safe socket = /var/log/dangann/dangann.sock # ... with appropriate permissions - may be needed chmod-socket = 664 # clear environment on exit vacuum = true
# use python thread enable-threads = true
# set request block time harakiri = 600 # body size # buffer-size buffer-size=32768