autoindex directive in 'if' section

B.R. reallfqq-nginx at yahoo.fr
Wed Feb 1 21:45:44 UTC 2012


Hello,

Finally, a little something still annoying me...

Since the location is based on the new /post_redirect/ folder, the indexing
page shows:
Index of /post_redirect/*******

It is unaesthetic to me, since I would like the original URI there. :o\
Any trick on that?
---
*B. R.*


On Fri, Jan 27, 2012 at 22:16, B.R. <reallfqq-nginx at yahoo.fr> wrote:

> So simple...
> Thanks for everything Max, it works perfectly! ;o)
> ---
> *B. R.*
>
>
> On Fri, Jan 27, 2012 at 19:36, Max <nginxyz at mail.ru> wrote:
>
>>  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.
>> http://wiki.nginx.org/HttpCoreModule#alias Use alias instead of root, it
>> does exactly what you need: location ~ ^/post_rewrite/(.*)$ { internal;
>> autoindex on; alias /sandbox/$1; } Max
>>
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120201/57431e75/attachment.html>


More information about the nginx mailing list