Opened 13 years ago

Closed 11 years ago

#90 closed defect (fixed)

location search tree incorrect on case-insensitive systems

Reported by: openid.yandex.ru/enyby Owned by: somebody
Priority: minor Milestone:
Component: nginx-core Version: 1.0.x
Keywords: Cc:
uname -a: Microsoft Windows XP [Версия 5.1.2600]
nginx -V: nginx version: nginx/1.0.11
TLS SNI support enabled
configure arguments: --with-cc=cl --builddir=objs.msvc8 --with-debug --prefix= -
-conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access
.log --error-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-te
mp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fast
cgi-temp-path=temp/fastcgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs
.msvc8/lib/pcre-8.12 --with-zlib=objs.msvc8/lib/zlib-1.2.5 --with-select_module
--with-http_realip_module --with-http_addition_module --with-http_sub_module --w
ith-http_dav_module --with-http_stub_status_module --with-http_flv_module --with
-http_mp4_module --with-http_gzip_static_module --with-http_random_index_module
--with-http_secure_link_module --with-mail --with-openssl=objs.msvc8/lib/openssl
-0.9.8r --with-openssl-opt=enable-tlsext --with-http_ssl_module --with-mail_ssl_
module --with-ipv6

Description

I tried run query:
/ftp/Library/SomeLibrary/other/file.txt
or any other query:
/ftp/Library/SomeLibrary/*

I want to work location /ftp/Library/SomeLibrary, but this location silly ignore. And selected default location "".
But for page 404 this location is tested. Why?

I am use FileMon and enable debug log:

2012/01/27 22:33:27 [debug] 4824#5920: *95105 http request line: "GET /ftp/Library/SomeLibrary/other/file.txt HTTP/1.1"
2012/01/27 22:33:27 [debug] 4824#5920: *95105 http uri: "/ftp/Library/SomeLibrary/other/file.txt"
2012/01/27 22:33:27 [debug] 4824#5920: *95105 http args: ""
2012/01/27 22:33:27 [debug] 4824#5920: *95105 http exten: "txt"
2012/01/27 22:33:27 [debug] 4824#5920: *95105 http process request header line
2012/01/27 22:33:27 [debug] 4824#5920: *95105 http header: "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*"
2012/01/27 22:33:27 [debug] 4824#5920: *95105 http header: "Accept-Language: ru"
2012/01/27 22:33:27 [debug] 4824#5920: *95105 http header: "UA-CPU: x86"
2012/01/27 22:33:27 [debug] 4824#5920: *95105 http header: "Accept-Encoding: gzip, deflate"
2012/01/27 22:33:27 [debug] 4824#5920: *95105 http header: "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)"
2012/01/27 22:33:27 [debug] 4824#5920: *95105 http header: "Host: inethub.olvi.net.ua:82"
2012/01/27 22:33:27 [debug] 4824#5920: *95105 http header: "Connection: Keep-Alive"
2012/01/27 22:33:27 [debug] 4824#5920: *95105 http header done
2012/01/27 22:33:27 [debug] 4824#5920: *95105 event timer del: 236: 551573295
2012/01/27 22:33:27 [debug] 4824#5920: *95105 generic phase: 0
2012/01/27 22:33:27 [debug] 4824#5920: *95105 rewrite phase: 1
2012/01/27 22:33:27 [debug] 4824#5920: *95105 test location: "/ftp/pub/KPI/Selena"
2012/01/27 22:33:27 [debug] 4824#5920: *95105 test location: "/ftp/Library/share"
2012/01/27 22:33:27 [debug] 4824#5920: *95105 using configuration ""
2012/01/27 22:33:27 [debug] 4824#5920: *95105 http cl:-1 max:1048576
2012/01/27 22:33:27 [debug] 4824#5920: *95105 rewrite phase: 3
2012/01/27 22:33:27 [debug] 4824#5920: *95105 post rewrite phase: 4
2012/01/27 22:33:27 [debug] 4824#5920: *95105 generic phase: 5
2012/01/27 22:33:27 [debug] 4824#5920: *95105 generic phase: 6
2012/01/27 22:33:27 [debug] 4824#5920: *95105 generic phase: 7
2012/01/27 22:33:27 [debug] 4824#5920: *95105 access phase: 8
2012/01/27 22:33:27 [debug] 4824#5920: *95105 access phase: 9
2012/01/27 22:33:27 [debug] 4824#5920: *95105 post access phase: 10
2012/01/27 22:33:27 [debug] 4824#5920: *95105 try files phase: 11
2012/01/27 22:33:27 [debug] 4824#5920: *95105 content phase: 12
2012/01/27 22:33:27 [debug] 4824#5920: *95105 content phase: 13
2012/01/27 22:33:27 [debug] 4824#5920: *95105 content phase: 14
2012/01/27 22:33:27 [debug] 4824#5920: *95105 content phase: 15
2012/01/27 22:33:27 [debug] 4824#5920: *95105 content phase: 16
2012/01/27 22:33:27 [debug] 4824#5920: *95105 content phase: 17
2012/01/27 22:33:27 [debug] 4824#5920: *95105 http filename: "d:/server/site/www/ftp/Library/SomeLibrary/other/file.txt"
2012/01/27 22:33:27 [debug] 4824#5920: *95105 add cleanup: 00C001B4
2012/01/27 22:33:27 [error] 4824#5920: *95105 CreateFile() "d:/server/site/www/ftp/Library/SomeLibrary/other/file.txt" failed (3: Системе не удается найти указанный путь), client: 192.168.3.10, server: inethub.olvi.net.ua, request: "GET /ftp/Library/SomeLibrary/other/file.txt HTTP/1.1", host: "inethub.olvi.net.ua:82"
2012/01/27 22:33:27 [debug] 4824#5920: *95105 http finalize request: 404, "/ftp/Library/SomeLibrary/other/file.txt?" a:1, c:1
2012/01/27 22:33:27 [debug] 4824#5920: *95105 http special response: 404, "/ftp/Library/SomeLibrary/other/file.txt?"
2012/01/27 22:33:27 [debug] 4824#5920: *95105 internal redirect: "/404.php?"
2012/01/27 22:33:27 [debug] 4824#5920: *95105 rewrite phase: 1
2012/01/27 22:33:27 [debug] 4824#5920: *95105 test location: "/ftp/pub/KPI/Selena"
2012/01/27 22:33:27 [debug] 4824#5920: *95105 test location: "/ftp/Library/share"
2012/01/27 22:33:27 [debug] 4824#5920: *95105 test location: "/ftp/Library/SomeLibrary"
2012/01/27 22:33:27 [debug] 4824#5920: *95105 using configuration ""
2012/01/27 22:33:27 [debug] 4824#5920: *95105 http cl:-1 max:1048576
2012/01/27 22:33:27 [debug] 4824#5920: *95105 rewrite phase: 3
2012/01/27 22:33:27 [debug] 4824#5920: *95105 post rewrite phase: 4
2012/01/27 22:33:27 [debug] 4824#5920: *95105 generic phase: 5
2012/01/27 22:33:27 [debug] 4824#5920: *95105 generic phase: 6
2012/01/27 22:33:27 [debug] 4824#5920: *95105 generic phase: 7
2012/01/27 22:33:27 [debug] 4824#5920: *95105 access phase: 8
2012/01/27 22:33:27 [debug] 4824#5920: *95105 access phase: 9
2012/01/27 22:33:27 [debug] 4824#5920: *95105 post access phase: 10
2012/01/27 22:33:27 [debug] 4824#5920: *95105 try files phase: 11
2012/01/27 22:33:27 [debug] 4824#5920: *95105 content phase: 12
2012/01/27 22:33:27 [debug] 4824#5920: *95105 content phase: 13
2012/01/27 22:33:27 [debug] 4824#5920: *95105 content phase: 14
2012/01/27 22:33:27 [debug] 4824#5920: *95105 content phase: 15
2012/01/27 22:33:27 [debug] 4824#5920: *95105 content phase: 16
2012/01/27 22:33:27 [debug] 4824#5920: *95105 content phase: 17
2012/01/27 22:33:27 [debug] 4824#5920: *95105 http filename: "d:/server/site/www/404.php"

22:44:21 nginx.exe:4824 QUERY INFORMATION D:\server\site\www\ftp\Library\SomeLibrary\other\file.txt PATH NOT FOUND Attributes: Error

Part of configuration:

server {

listen 82;
server_name localhost;
root d:/server/site/www;


error_page 404 /404.php;


location /uz/ {

#try_files $uri /uz/log.php;

}



location /ftp/Library/SomeLibrary {

alias H:/Shara/SomeLibrary;
#try_files $uri /dir-generator.php;

}


location /ftp/pub/KPI/Selena {

alias F:/S;
#try_files $uri /dir-generator.php;

}


location /ftp/pub/Multimedia {

alias H:/Shara/Multimedia;
#try_files $uri /dir-generator.php;

}


location /ftp/Library/share {

alias G:/share;
#try_files $uri /dir-generator.php;

}


}

OS: Windows XP SP3

Change History (5)

comment:1 by Maxim Dounin, 13 years ago

Status: newaccepted

There is a problem with building location search tree under case-insensitive systems if mixed-case strings are used in location directives. As a workaround, try spelling all locations in lowercase.

comment:2 by openid.yandex.ru/enyby, 13 years ago

Thanks for the advice. In the lower register of all works, though it is very inconvenient.

comment:3 by Maxim Dounin, 13 years ago

Summary: Location ignorelocation search tree incorrect on case-insensitive systems

comment:4 by Maxim Dounin <mdounin@…>, 11 years ago

In fbaae7d1c0330daf3c9259b6308bc1a58ea99ed8/nginx:

Caseless location tree construction (ticket #90).

Location tree was always constructed using case-sensitive comparison, even
on case-insensitive systems. This resulted in incorrect operation if
uppercase letters were used in location directives. Notably, the
following config:

location /a { ... }
location /B { ... }

failed to properly map requests to "/B" into "location /B".

comment:5 by Maxim Dounin, 11 years ago

Resolution: fixed
sensitive: 0
Status: acceptedclosed

Fix committed.

Note: See TracTickets for help on using tickets.