I started from https://gist.github.com/mattd/1006398 and now I have this:
root /data/example.com;
location /sites/default/files/ {
try_files $uri @proxy;
}
location / {
try_files @proxy;
}
location @proxy {
proxy_pass http://127.0.0.1:8088;
}
Of course, this is not valid syntax. How can I make this work? Basically, I want sites/default/files
to serve the file directly if it exists and use @proxy
otherwise. Other directories should go to @proxy
immediately. I do not want to copy-paste the @proxy
configuration because a lot more will be added there (caching). I will also have other directories that should be served directly for example .well-known
.
/data/example.com
contain/sites/default/files/
? If so: 1.) Remove the locationlocation /sites/default/files/ { [...] }
directive. 2.) Add$uri
to thetry_files
directive inlocation / { [...] }
.internal;
directive for that purpose.