Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# the upstream component NGINX needs to connect to
upstream django {
server unix:/run/uwsgi/django.sock;
server {
listen 80;
charset utf-8;
# max upload size
client_max_body_size 20M;
# WordPress configuration
root /var/www/vndeveloper/html;
index index.php;
location / {
location ~ \.php$ {
# Django Stuff
# Django media & static
location ^~ /media {
alias /var/www/vndeveloper/djangodemo/public/media;
location ^~ /static {
alias /var/www/vndeveloper/djangodemo/public/static;
# Finally, send all non-media requests to the Django server.
location /django-demo/ {
include uwsgi_params;
uwsgi_pass django;
uwsgi_param SCRIPT_NAME /django-demo;
uwsgi_param Host $host;
uwsgi_param X-Real-IP $remote_addr;
uwsgi_param X-Forwarded-For $proxy_add_x_forwarded_for;
uwsgi_param X-Forwarded-Proto $http_x_forwarded_proto;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment