ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Не рабоает alias


  • To: nginx-ru@xxxxxxxxx
  • Subject: Re: Не рабоает alias
  • From: Roxis <roxis@xxxxxxx>
  • Date: Sat, 20 Sep 2008 17:39:50 +0200
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :references:in-reply-to:x-face:x-mailer:mime-version:content-type :content-transfer-encoding:content-disposition:message-id:sender; bh=2O8TM/YEawcfYXHcEQ/9zGNAle230XqsVIU7Ql40cJw=; b=X9i5CwCypZ9e669y+jb4E5rPOM7QL7E4M7KgeK22wLu5TZJgPBxumpatvNQ5HJtgxF CWlNx5edv7U87KP9iCBQOP61V8JfPQ4xZkl5df9R7hQEDmL0xud8BVtNRSm+JdUdsWm6 yccPRm6El1487jtpUQ1xwN7S2wh9IQlJpgDss=
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:references:in-reply-to:x-face:x-mailer :mime-version:content-type:content-transfer-encoding :content-disposition:message-id:sender; b=LRgEeWJoL+LZkYVz2m3ANLFzk5/eSmhLsdJhZ0419cYngnLIEJ4lSZb6KTidwDIJ0t bLVVGs+dofBbLARn9JJ1uHyFGmWSyVxIgU7B7Tx4HVdCvLyuDIZNr4YlEPU8hWFKpnCO aB6sPlkvrFwNwav9Tr5GAzJfEvk1maONDL/fM=
  • In-reply-to: <bf2ab1eb0809200826p220eb6cet8b772347eeb71ba8@xxxxxxxxxxxxxx>
  • References: <bf2ab1eb0809200826p220eb6cet8b772347eeb71ba8@xxxxxxxxxxxxxx>

On Saturday 20 September 2008, Rauan Maemirov wrote:
> nginx версии 0.7.13
>
> location /userpics/ {
>         alias /var/user/userpics/;
> }
>
> права на папку 777 и один и тот же юзер.
>
> там картинка лежит (имя файла "нормальное". jpg). но выдает 404.
>
> Чуть ниже еще один location.
>
>
> location ~ "\.(js|ico|gif|jpg|mp3|png|txt|css|swf)$" {
>         expires 30d;
>         root /home/project/html;
> }
>
> debug log
>
> 2008/09/06 21:02:53 [debug] 32336#0: *1 http uri: "/userpics/quessir.jpg"
> 2008/09/06 21:02:53 [debug] 32336#0: *1 http args: ""
> 2008/09/06 21:02:53 [debug] 32336#0: *1 http exten: "jpg"
> 2008/09/06 21:02:53 [debug] 32336#0: *1 http process request header line
> 2008/09/06 21:02:53 [debug] 32336#0: *1 http header: "Host: mysite.kz"
> 2008/09/06 21:02:53 [debug] 32336#0: *1 http header: "User-Agent:
> Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.0.1)
> Gecko/2008070208 Firefox/3.0.1"
> 2008/09/06 21:02:53 [debug] 32336#0: *1 http header: "Accept:
> text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
> 2008/09/06 21:02:53 [debug] 32336#0: *1 http header: "Accept-Language:
> en-us,en;q=0.5"
> 2008/09/06 21:02:53 [debug] 32336#0: *1 http header: "Accept-Encoding:
> gzip,deflate"
> 2008/09/06 21:02:53 [debug] 32336#0: *1 http header: "Accept-Charset:
> ISO-8859-1,utf-8;q=0.7,*;q=0.7"
> 2008/09/06 21:02:53 [debug] 32336#0: *1 http header: "Keep-Alive: 300"
> 2008/09/06 21:02:53 [debug] 32336#0: *1 http header: "Connection:
> keep-alive"
> 2008/09/06 21:02:53 [debug] 32336#0: *1 http header: "Cookie:
> PHPSESSID=vtqape9137kn0bjs630o1vqhq6"
> 2008/09/06 21:02:53 [debug] 32336#0: *1 http header done
> 2008/09/06 21:02:53 [debug] 32336#0: *1 event timer del: 16: 942721589
> 2008/09/06 21:02:53 [debug] 32336#0: *1 generic phase: 0
> 2008/09/06 21:02:53 [debug] 32336#0: *1 test location: "/"
> 2008/09/06 21:02:53 [debug] 32336#0: *1 test location: "services/upload/"
> 2008/09/06 21:02:53 [debug] 32336#0: *1 test location: "userpics/"
> 2008/09/06 21:02:53 [debug] 32336#0: *1 test location: ~ "\.php$"
> 2008/09/06 21:02:53 [debug] 32336#0: *1 test location: ~
> "\.(js|ico|gif|jpg|mp3|png|txt|css|swf)$"
> 2008/09/06 21:02:53 [debug] 32336#0: *1 using configuration
> "\.(js|ico|gif|jpg|mp3|png|txt|css|swf)$"
>
>
> Как видите перескакивает.

это ожидаемое поведение, читайте 
http://sysoev.ru/nginx/docs/http/ngx_http_core_module.html#location

вам нужно:

location ^~ /userpics/ {
 alias /var/user/userpics/;
}

или лучше:

location ^~ /userpics/ {
  root /var/user;
}



 




Copyright © Lexa Software, 1996-2009.