correct usage of location context?
Szymon Polom
sp at winterstille.net
Fri Jun 12 23:35:37 MSD 2009
Nick Pearson wrote:
> If you want to map a request to /test/x to /var/www/test/x instead of
> /var/www/test/test/x, it sounds like you need a rewrite to remove
> "/test" from the request URI. There may be another way of doing this,
> but basically:
>
> ...
> location /test {
> root /var/www/test;
> rewrite ^/test(.*)$ $1;
> }
> ...
>
> That will get rid of the "duplicate" /test in the final path nginx uses
> to access the filesystem. Also note that the new regular expression
> support in the "location" should make it easy to have a single block
> (like above) for many sites.
Thank you Nick, I tried it before already. It does a redirection for me
and goes stuff which is in
location / { root /var/www/main; }
instead of in /var/www/test.
More information about the nginx
mailing list