Django - Deployment and Production
How should you configure Nginx to serve static files from
/var/www/static/ and proxy all other requests to a Django app on port 8000?/var/www/static/ and proxy all other requests to a Django app on port 8000?alias /var/www/static/; inside location /static/ to map URL path to filesystem directory properly.proxy_pass http://localhost:8000; inside location / to forward all other requests to Django.root with /static/ location can cause path duplication issues.location /static/ {
alias /var/www/static/;
}
location / {
proxy_pass http://localhost:8000;
} correctly configures static serving and proxying.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions