непонятка с rewrite

Igor Sysoev is at rambler-co.ru
Sat Apr 9 21:33:23 MSD 2005


On Sat, 9 Apr 2005, RaPaMaN wrote:

> поймал я почему 404-я.
>
> 2005/04/09 12:28:32 [debug] 6334#0: *4254 find location
> 2005/04/09 12:28:32 [debug] 6334#0: *4254 find location: = "/"
> 2005/04/09 12:28:32 [debug] 6334#0: *4254 find location: "/"
> 2005/04/09 12:28:32 [debug] 6334#0: *4254 find location: ~ "\.(php)$"
> 2005/04/09 12:28:32 [debug] 6334#0: *4254 find location: ~ 
> "\.(jpg|jpeg|gif|png|css|ico|html|txt)$"
> 2005/04/09 12:28:32 [debug] 6334#0: *4254 find location: ~ 
> "(\.htaccess|\.htpasswd|htpasswd|htaccess|\.inc)$"
> 2005/04/09 12:28:32 [debug] 6334#0: *4254 http cl:-1 max:1048576
> 2005/04/09 12:28:32 [debug] 6334#0: *4254 http rewrite regex: "^.+$"
> 2005/04/09 12:28:32 [debug] 6334#0: *4254 http rewrite copy: "index.php"
> 2005/04/09 12:28:32 [debug] 6334#0: *4254 http rewrite regex end
> 2005/04/09 12:28:32 [debug] 6334#0: *4254 http set discard body
> 2005/04/09 12:28:32 [debug] 6334#0: *4254 http filename: 
> "/usr/local/nginx/htmlindex.php"
> 2005/04/09 12:28:32 [error] 6334#0: *4254 open() 
> "/usr/local/nginx/htmlindex.php" failed (2: No such file or directory), 
> client: xxx.xx.xxx.xxxx, server: domain.net, URL: "/en/expert/modules/", 
> host: "domain.net"
> 2005/04/09 12:28:32 [debug] 6334#0: *4254 http finalize request: 404
> 2005/04/09 12:28:32 [debug] 6334#0: *4254 http set discard body
> 2005/04/09 12:28:32 [debug] 6334#0: *4254 HTTP/1.1 404 Not Found
> Server: nginx/0.1.27
> Date: Sat, 09 Apr 2005 16:28:32 GMT
> Content-Length: 169
> Content-Type: text/html
> Connection: keep-alive
> Keep-Alive: timeout=20
>
>
> location / {
>   rewrite ^.+$ index.php;
> }
>
> почему-то вообще начало искать аж в руте nginx, наверное потому как не указан 
> root для текущей location.

На самом деле, не в руте nginx'а, а в /usr/local/nginx/html. Это root
по умолчанию.

Что касается того, что этот rewrite как будто имел флаг break, то есть,
после него не определялся location, то да, такое могло быть на случайной
основе. В 0.1.28 это исправленно.


Игорь Сысоев
http://sysoev.ru





More information about the nginx-ru mailing list