Welcome! Log In Create A New Profile

Advanced

Re: Problem when using subfolder

Bill Culp
December 25, 2012 11:54AM
ngnix docs state that the closest match will always be found in location phrases

So why is alias needed?

On Dec 25, 2012, at 8:07 AM, Maxim Dounin <mdounin@mdounin.ru> wrote:

> Hello!
>
> On Tue, Dec 25, 2012 at 11:04:03AM -0500, PascalTurbo wrote:
>
>> Hi There,
>>
>> need to solve the following Problem:
>>
>> location / should point to /var/www/myfirstside
>> and location /subside should point to /var/www/mysecondside
>>
>> I have no idea how to solve this.
>>
>> I tried:
>>
>> location / {
>> root /var/www/myfirstside
>> }
>>
>> location /subside {
>> root /var/www/mysecondside
>> }
>>
>> but this doesn't work because nginx send all requests for /subside to
>> /var/www/mysecondside/subside ...
>>
>> Could anybody help me?
>
> Try "alias":
>
> location / {
> root /var/www/myfirstside;
> }
>
> location /subside/ {
> alias /var/www/mysecondside/;
> }
>
> See http://nginx.org/r/alias for details.
>
> --
> Maxim Dounin
> http://nginx.com/support.html
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

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

Problem when using subfolder

PascalTurbo December 25, 2012 11:04AM

Re: Problem when using subfolder

Maxim Dounin December 25, 2012 11:08AM

Re: Problem when using subfolder

Bill Culp December 25, 2012 11:54AM

Re: Problem when using subfolder

Maxim Dounin December 25, 2012 01:06PM

Re: Problem when using subfolder

Bill Culp December 25, 2012 11:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 89
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