Looking for static content in multiple directories?

Due to the fact that our git repositories are installed, I have some static content that can be in one directory - and other content that can be in another directory. How can I ask nginx to search in two places for a static file such as a stylesheet?

I initially thought try_files has my answer - but I can't get it to work.

try_files $uri /dir1/static/$uri /dir2/static/$uri @missing; 
+6
webserver nginx
source share
1 answer
 location ~* ^/just_test/(.+)$ { root /some/path/to/web/root; try_files /just_test/1/$1 /just_test/2/$1 /just_test/3/$1 @missing; } 
+10
source share

All Articles