What is the difference between alias and root

I was wondering what the difference was between alias and root in the
server
block on nginx was?

They seem to provide the same functionality.

James

On Sat, Sep 11, 2010 at 09:35:10PM -0700, James Matthews wrote:

I was wondering what the difference was between alias and root in the server
block on nginx was?

They seem to provide the same functionality.

The alias is supported on a location level only for the obvious reason.


Igor S.
http://sysoev.ru/en/

James Matthews Wrote:

I was wondering what the difference was between
alias and root in the server
block on nginx was?

There’s a subtle difference.

# This will result in files being searched for in /foo/bar/bar as the
full URI is appended.
location /bar {
    root /foo/bar;
}

# This will result in files being searched for in /foo/bar as only the
URI part after /bar is appended.
location /bar {
    alias /foo/bar;
}

Posted at Nginx Forum: