[Answer]-Django+gunicorn+nginx wierdness

1๐Ÿ‘

โœ…

I think you are looking to use alias:

location /static {
    alias /webapps/myproject/project_staticfiles;
}

If you read the docs on root, it states:

root specifies the document root for the requests. For example, with this configuration:

location  /i/ {   
    root  /spool/w3; 
} 

A request for โ€œ/i/top.gifโ€ will return the file โ€œ/spool/w3/i/top.gifโ€.
You can use variables in the argument.

root appends the directory into the filepath, alias does not, that is why, static gets appended to your root to form /webapps/myproject/project_staticfiles/static

๐Ÿ‘คSanketh Katta

Leave a comment