Skip to content

Instantly share code, notes, and snippets.

@tyaakow
Last active August 24, 2018 06:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyaakow/1cd0a30095000c11301d3359b13a3537 to your computer and use it in GitHub Desktop.
Save tyaakow/1cd0a30095000c11301d3359b13a3537 to your computer and use it in GitHub Desktop.
NGINX virtualhost configuration file for Django & uWSGI setup
# the upstream component nginx needs to connect to
upstream django {
server unix:///tmp/minaguide.sock;
}
# configuration of the server
server {
# the port your site will be served on
listen 80;
# the domain name it will serve for
server_name myxydomain.com; # substitute with your domain name
charset utf-8;
# max upload size
client_max_body_size 75M; # adjust to taste
# Django media
location /media {
alias /root/project/minaguide/current/media; # your Django project's media files - amend as required
}
location /static {
alias /root/project/minaguide/current/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/project/minaguide/current/uwsgi/uwsgi_params; # the uwsgi_params file you installed
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment