Last active
December 2, 2019 21:43
-
-
Save hiendnguyen/8625fdd9c8088aae397689339f58143f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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