You can set the root to the common prefix of the two paths that you want to use (in this case /), and then just specify the rest of the paths in the try_files files:
location /static/ { root /; try_files /tmp$uri /srv/www/site$uri =404; expires 30d; access_log off; }
You may not seem to like using root / in a location, but try_files ensures that files outside of / tmp / static or / srv / www / site / static will not be uploaded.
kolbyjack
source share