Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@hiendnguyen
Last active December 2, 2019 21:43
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 hiendnguyen/8625fdd9c8088aae397689339f58143f to your computer and use it in GitHub Desktop.
Save hiendnguyen/8625fdd9c8088aae397689339f58143f to your computer and use it in GitHub Desktop.
# the upstream component NGINX needs to connect to
upstream django {
server unix:/run/uwsgi/django.sock;
}
server {
listen 80;
server_name www.vndeveloper.com;
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