Trying to do the opposite of www.domain.com -> domain.com

Igor Sysoev is at rambler-co.ru
Mon Sep 1 11:44:39 MSD 2008


On Mon, Sep 01, 2008 at 12:43:58AM -0700, mike wrote:

> On 9/1/08, Igor Sysoev <is at rambler-co.ru> wrote:
> 
> > There is no difference for "root" directive. Actually, nginx deletes
> > trailing slash from "root" directive because $request_file_name is
> > $document_root$uri", and $uri has slash as first character.
> >
> > But the trailing slash is important for "alias" directive, because
> > "alias" literally replaces location part of URI:
> >
> > location /dir/ {
> >     alias  /path/to/;
> > }
> >
> > /dir/file > /path/to/file
> 
> Gotcha. Thanks.

Just to make clean:

location /dir/ {
    alias  /path/to;
}

/dir/file > /path/tofile

or

location /dir {
    alias  /path/to/;
}

/dir/file > /path/to//file


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list