ПРОЕКТЫ 


  АРХИВ 


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]

alias создает редирект


  • To: nginx-ru@xxxxxxxxx
  • Subject: alias создает редирект
  • From: "VadimK" <nginx-forum@xxxxxxxx>
  • Date: Sun, 11 Dec 2011 17:14:54 -0500
  • Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mickey.jlkhosting.com; s=x; h=Date:Sender:From:Message-ID:Content-Transfer-Encoding:Content-Type:Subject:To; bh=fdt4nf0hiOXARypUcGtTkWhzuZ2HnKryLbuaA/WVJ9c=; b=XCqrMMIFh5ChCQ315VVEFLNvs+NiZLj6XfqRe29r3CLsklNFB2l37D1xEvrO0mZLM1QQw4+dMNJgBG5DOzsadTgkGF4Y6Ecy4NYyetyIUCp1JzK8/TE3Rctt0aX7IsEN;

Ситуация следующая: 
1. есть сайт site.com расположенный по пути
/www/site.com 
2. есть движок, расположенный вне сайта.
Скажем /www/core

Теперь необходимо, что бы при запросе
site.com/cms/any.file.txt запрашивался файл
/www/core/any.file.txt

На локальном компьютере это сделано
следующим образом:
location ~ ^/cms {
   alias /www/core/;
}
и это работает. 

Но как только ставлю на сервер, то
идентичная структура уже не роботает.
Почему то получает редирект:

Connecting to site.com[XXX.XXX.XXX.XXX]:82... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://site.com:82/cms/license.txt/ [following]
--00:05:51--  http://site.com:82/cms/license.txt/
           => `index.html'
Connecting to site.com[XXX.XXX.XXX.XXX]:82... connected.
HTTP request sent, awaiting response... 403 Forbidden
00:05:51 ERROR 403: Forbidden.

В логах идет следующее:

2011/12/12 10:58:45 [debug] 25987#0: delete posted event 09EFEEE0
2011/12/12 10:58:45 [debug] 25987#0: accept on 0.0.0.0:82, ready: 0
2011/12/12 10:58:45 [debug] 25987#0: posix_memalign: 09EBCFF0:256 @16
2011/12/12 10:58:45 [debug] 25987#0: *18 accept: 78.56.111.111 fd:5
2011/12/12 10:58:45 [debug] 25987#0: *18 event timer add: 5:
60000:834058065
2011/12/12 10:58:45 [debug] 25987#0: *18 epoll add event: fd:5 op:1
ev:80000001
2011/12/12 10:58:45 [debug] 25987#0: *18 post event 09EFEF48
2011/12/12 10:58:45 [debug] 25987#0: *18 delete posted event 09EFEF48
2011/12/12 10:58:45 [debug] 25987#0: *18 malloc: 09EBED68:660
2011/12/12 10:58:45 [debug] 25987#0: *18 malloc: 09EBF000:1024
2011/12/12 10:58:45 [debug] 25987#0: *18 posix_memalign: 09EBF420:4096
@16
2011/12/12 10:58:45 [debug] 25987#0: *18 http process request line
2011/12/12 10:58:45 [debug] 25987#0: *18 recv: fd:5 119 of 1024
2011/12/12 10:58:45 [debug] 25987#0: *18 http request line: "GET
/cms/license.txt HTTP/1.0"
2011/12/12 10:58:45 [debug] 25987#0: *18 http uri: "/cms/license.txt"
2011/12/12 10:58:45 [debug] 25987#0: *18 http args: ""
2011/12/12 10:58:45 [debug] 25987#0: *18 http exten: "txt"
2011/12/12 10:58:45 [debug] 25987#0: *18 http process request header
line
2011/12/12 10:58:45 [debug] 25987#0: *18 http header: "User-Agent:
Wget/1.8.2"
2011/12/12 10:58:45 [debug] 25987#0: *18 http header: "Host:
site.com:82"
2011/12/12 10:58:45 [debug] 25987#0: *18 http header: "Accept: */*"
2011/12/12 10:58:45 [debug] 25987#0: *18 http header: "Connection:
Keep-Alive"
2011/12/12 10:58:45 [debug] 25987#0: *18 http header done
2011/12/12 10:58:45 [debug] 25987#0: *18 event timer del: 5: 834058065
2011/12/12 10:58:45 [debug] 25987#0: *18 rewrite phase: 0
2011/12/12 10:58:45 [debug] 25987#0: *18 http script value:
"/www/site.com/"
2011/12/12 10:58:45 [debug] 25987#0: *18 http script set
$server_web_root
2011/12/12 10:58:45 [debug] 25987#0: *18 test location: ~ "^/cms"
2011/12/12 10:58:45 [debug] 25987#0: *18 using configuration "^/cms"
2011/12/12 10:58:45 [debug] 25987#0: *18 http cl:-1 max:1048576
2011/12/12 10:58:45 [debug] 25987#0: *18 rewrite phase: 2
2011/12/12 10:58:45 [debug] 25987#0: *18 post rewrite phase: 3
2011/12/12 10:58:45 [debug] 25987#0: *18 generic phase: 4
2011/12/12 10:58:45 [debug] 25987#0: *18 generic phase: 5
2011/12/12 10:58:45 [debug] 25987#0: *18 access phase: 6
2011/12/12 10:58:45 [debug] 25987#0: *18 access phase: 7
2011/12/12 10:58:45 [debug] 25987#0: *18 post access phase: 8
2011/12/12 10:58:45 [debug] 25987#0: *18 content phase: 9
2011/12/12 10:58:45 [debug] 25987#0: *18 content phase: 10
2011/12/12 10:58:45 [debug] 25987#0: *18 content phase: 11
2011/12/12 10:58:45 [debug] 25987#0: *18 http script copy: "/www/core/"
2011/12/12 10:58:45 [debug] 25987#0: *18 http filename: "/www/core/"
2011/12/12 10:58:45 [debug] 25987#0: *18 add cleanup: 09EBF998
2011/12/12 10:58:45 [debug] 25987#0: *18 http static fd: -1
2011/12/12 10:58:45 [debug] 25987#0: *18 http dir
2011/12/12 10:58:45 [debug] 25987#0: *18 http finalize request: 301,
"/cms/license.txt?" a:1, c:1
2011/12/12 10:58:45 [debug] 25987#0: *18 http special response: 301,
"/cms/license.txt?"
2011/12/12 10:58:45 [debug] 25987#0: *18 http set discard body
2011/12/12 10:58:45 [debug] 25987#0: *18 HTTP/1.1 301 Moved Permanently
Server: nginx/1.1.10
Date: Mon, 12 Dec 2011 09:58:45 GMT
Content-Type: text/html
Content-Length: 185
Location: http://site.com:82/cms/license.txt/
Connection: keep-alive

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?21,219890,219890#msg-219890

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.