Welcome! Log In Create A New Profile

Advanced

Re: multiple roots for multiple sites

Maxim Dounin
May 14, 2010 07:32PM
Hello!

On Fri, May 14, 2010 at 03:31:00PM -0700, John Magolske wrote:

> I'm working on multiple sites & would like to specify different
> roots for each one so that identical absolute urls such as
> <a href="/index.html">Home</a> on each site don't all get
> directed to the same /usr/local/nginx/html/index.html
>
> ie,
>
> navigate to http://localhost/site1 & the root will be
> /usr/local/nginx/html/site1
>
> navigate to http://localhost/site2 & the root will be
> /usr/local/nginx/html/site2
>
> I tried this:
>
> location /site1/ {
> root /usr/local/nginx/html/site1;

- root /usr/local/nginx/html/site1;
+ alias /usr/local/nginx/html/site1/;

Directive "root" defines path to a server root (i.e. to "/"
uri), and filename calculated as <root> + <uri>.

Directive "alias" specifies path to a matched location, and
filename calculated as <alias> + <part of uri not matched by
location>.

See here for details:

http://wiki.nginx.org/NginxHttpCoreModule#root
http://wiki.nginx.org/NginxHttpCoreModule#alias

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

multiple roots for multiple sites

John Magolske May 14, 2010 06:36PM

Re: multiple roots for multiple sites

Fernando Perez May 14, 2010 06:36PM

Re: multiple roots for multiple sites

John Magolske May 14, 2010 07:04PM

Re: multiple roots for multiple sites

Fernando Perez May 15, 2010 06:18AM

Re: multiple roots for multiple sites

Maxim Dounin May 14, 2010 07:32PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 218
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready