correct usage of location context?

lejeczek peljasz at yahoo.co.uk
Fri Jun 12 21:23:11 MSD 2009


would not it be a trailing(redundant) slash in location statement? - 
location /test

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; how 
> can I force nginx to e.g.
>
> serve everything beginning with /redmine/
> from /var/www/redmine/public
>
> ?
>
> Any help would be appreciated.
>
>





More information about the nginx mailing list