Want basically the static file_server where, if the file to serve is not in directory A, it will look to see if the file is in directory B. Similar to a union file system.
That’s because you’ve set your root to /directoryA.
Instead, include the root in your various try_files paths, e.g. try_files {path} /directoryA/{path} /directoryB/{path}
Just keep in mind that anything in your site root could potentially be served by the server, so make sure there’s nothing in your root that you don’t want made public.
Okay, I think I’ve figured out where my difficulties lay. The problem is at least one of my directories lies outside the root. I’ve setup the following minimum example with the following files:
With the way my project is setup, I’m really hoping I could use a configuration similar to the former though, where the try_files directories in question are outside the root.
example.com {
root * /test/root
@not-in-root not file {path}
route @not-in-root {
root * /test/a
@not-in-a not file {path}
route @not-in-a {
root * /test/b
file_server # will 404 at this point if not there
}
file_server
}
file_server
}