upstream django { server unix:/usr/src/app/deploy/app.sock; # for a file socket # server 127.0.0.1:8001; # for a web port socket (we'll use this first) }
# configuration of the server server { # the port your site will be served on, default_server indicates that this server block # is the block to use if no blocks match the server_name listen80 default_server;
# the domain name it will serve for server_name .example.com; # substitute your machine's IP address or FQDN charset utf-8;
# max upload size client_max_body_size75M; # adjust to taste
location /static { alias /usr/share/nginx/html/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 /usr/src/app/deploy/uwsgi_params; # the uwsgi_params file you installed } }
[uwsgi] # this config will be loaded if nothing specific is specified # load base config from below ini = :base
# %d is the dir this configuration file is in socket = /usr/src/app/deploy/app.sock master = true processes = 4
[dev] ini = :base # socket (uwsgi) is not the same as http, nor http-socket socket = :8001
[local] ini = :base http = :8000 # set the virtual env to use
[base] # chdir to the folder of this config file, plus app/website chdir = /usr/src/app # load the module from wsgi.py, it is a python path from # the directory above. module=${PROJECT}:application # allow anyone to connect to the socket. This is very permissive chmod-socket=666