ПРОЕКТЫ 


  АРХИВ 


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: "Rauan Maemirov" <rauan1987@xxxxxxxxx>
  • Date: Sat, 20 Sep 2008 21:53:51 +0600
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=nrtdT73VvxmOTv2UufJFhe6kXcjkcb/38GPgj1PGDko=; b=LE6hVpEr/BCY2boUiR3gxq14NZjS24PF9WLj7rTRpNeK2P42omVYoW7mmFA0hExOkU m5fknAww/RF9/gyTh48BmvXMoTLSWlaziqepC417FdG9JwXPXj60UFpFg/Pv/87LLqig n64LygglFVIHxTuGzX2W/4k2mNFjGf+4Jxp1I=
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=WnDUS/Mjqjke5yELHzh4Lcz/NoQHq3hr/GTvpFwiXvXLIrAcagXUe2RSdmMm4Iq2YG X6NafOwjVIykplfTjfX5HRskCY6TzWbA4by2V0j2hRA8YV34hbcxgurWjRx3zayYzKD0 5yps3eK0HdXO8xjkOJh/SD6l+pV52uU7JRTOw=
  • In-reply-to: <200809201739.50487.roxis@xxxxxxx>
  • References: <bf2ab1eb0809200826p220eb6cet8b772347eeb71ba8@xxxxxxxxxxxxxx> <200809201739.50487.roxis@xxxxxxx>

Спасибо, Roxis.

Теперь заработало.

Может лучше исправить в документации?
http://sysoev.ru/nginx/docs/http/ngx_http_core_module.html#alias

2008/9/20 Roxis <roxis@xxxxxxx>
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.