Welcome! Log In Create A New Profile

Advanced

Re: correct usage of location context?

June 12, 2009 03:18PM
On Fri, Jun 12, 2009 at 06:05:34PM +0200, Szymon Polom wrote:

> I'm trying to shift my nginx instance from a multi-subdomain-setting to
> a one-domain-setting. I have the following config in the same server
> context:
>
> location /redmine/ {
> root /var/www/redmine/public;
> passenger_enabled on;
> }
>
> location /test/ {
> root /var/www/test;
> autoindex on;
> }
>
> location / {
> root /var/www/main;
> autoindex on;
> }
>
> When I try to access http://example.com/test/testfile, nginx tries to
> read the file at /var/www/test/test/testfile instead of at
> /var/www/test/testfile. I guess my configuration is not correct;

As it was already said by Cliff:

location /test/ {
root /var/www;
autoindex on;
}

> how can I force nginx to e.g.
>
> serve everything beginning with /redmine/
> from /var/www/redmine/public
>
> ?

location /redmine/ {
alias /var/www/redmine/public/;
}


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

correct usage of location context?

Szymon Polom June 12, 2009 12:05PM

Re: correct usage of location context?

lejeczek June 12, 2009 01:23PM

Re: correct usage of location context?

Cliff Wells June 12, 2009 01:54PM

Re: correct usage of location context?

Szymon Polom June 12, 2009 02:31PM

Re: correct usage of location context?

Nick Pearson June 12, 2009 02:57PM

Re: correct usage of location context?

Cliff Wells June 12, 2009 03:15PM

Re: correct usage of location context?

Szymon Polom June 12, 2009 03:35PM

Re: correct usage of location context?

Cliff Wells June 12, 2009 03:07PM

Re: correct usage of location context?

Szymon Polom June 12, 2009 02:01PM

Re: correct usage of location context?

Igor Sysoev June 12, 2009 03:18PM

Re: correct usage of location context?

Szymon Polom June 12, 2009 05:01PM

Re: correct usage of location context?

Igor Sysoev June 13, 2009 12:53AM

Re: correct usage of location context?

Avleen Vig June 13, 2009 10:46AM

Re: correct usage of location context?

Szymon Polom June 13, 2009 11:18AM

Re: correct usage of location context?

Rob Schultz June 12, 2009 09:35PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 221
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready