> location ~ ^/(testgalleries|galleries|poll|news)(/|$) BTW, obviously I added 'photos' to the location on the server before I tested this, just not in the one I posted. Ah the joys of hitting 'send' before proofreading. So obviously the question re: finding the filename even if it's buried in a few layers of subdirectories still stands. Thanks.