You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 29, 2020. It is now read-only.
As noted on Twitter earlier i was wondering if the recommendation for setting up nginx should come with a warning to make sure the root var in the nginx config is pointing to a directory with your static files not the root of your django app.
Your config uses the handy try_files shortcut:
root /var/www/domain.com/;
# Check if a file exists at /var/www/domain/ for the incoming request.
# If it doesn't proxy to Gunicorn/Django.
try_files $uri @django;
This is fine if domain.com has your static files but if you deploy a standard (instead of your suggestion from another part of the best practices) django app layout on your server it will make any python file, including your settings, available for download.
For instance if this is (part of) your app layout:
Obviously this is bad and you should not point the root to your app but i'm betting people will read that tip which they will find when googling and then do exactly this...