autoindex directive in 'if' section

Max nginxyz at
Sat Jan 28 00:36:47 UTC 2012

 28 января 2012, 03:11 от "B.R." : > To end the job, I need to get rid of the 'post_rewrite' part of the path, > so my files get served as '/path/to/files' and not > '/post_rewrite/path/to/files'. > I tried rewrite, but of course that gets me out of the current location > block...... > > Should I replace the content of $uri? Is there any variable regex > substitution mechanism in nginx? > Couldn't find that on Google nor wiki. Maybe I am not searching for the > right thing. Use alias instead of root, it does exactly what you need: location ~ ^/post_rewrite/(.*)$ { internal; autoindex on; alias /sandbox/$1; } Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list