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
Source:stackexchange.com