ПРОЕКТЫ 


  АРХИВ 


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: Ошибка при Redirect'ах



On Mon, 11 Jul 2005, beholderk wrote:

Проблема следующая:
В Apache делается Редирект, т.е. Выставляется Код, статус и Content-Type в виде:
HTTP/1.1 302 Found
Content-Type: text/xml
Connection: close
Location: /test/

По идее это должно прозрачно предаваться через Реверс прокси и самое интересное 
что до версии 1.26 это так и делалось
А вот только сейчас обратил внимание, что теперь вместо ожидаемого выдается в 
виде:
HTTP/1.1 302 Found
Server: nginx/0.1.38
Date: Mon, 11 Jul 2005 11:59:00 GMT
Content-Type: text/html
Content-Length: 193
Connection: close
Location: /test/

<html>
<head><title>500 Internal Server Error</title></head>
<body bgcolor="white">
<center><h1>500 Internal Server Error</h1></center>
<hr><center>nginx/0.1.38</center>
</body>
</html>

Т.е. Дописывается HTML текст и выставляется text/html Content-Type
С чем это может быть связано?

Это ошибка. Прилагаемый патч должен помочь.


Игорь Сысоев
http://sysoev.ru
--- src/http/ngx_http_upstream.c        Fri Jul  8 13:58:20 2005
+++ src/http/ngx_http_upstream.c        Mon Jul 11 19:10:54 2005
@@ -1622,6 +1623,10 @@
     if (r->upstream->rewrite_redirect) {
         rc = r->upstream->rewrite_redirect(r, ho, 0);
 
+        if (rc == NGX_DECLINED) {
+            return NGX_OK;
+        }
+
         if (rc == NGX_OK) {
             r->headers_out.location = ho;
 
@@ -1664,6 +1669,10 @@
             rc = r->upstream->rewrite_redirect(r, ho, p + 4 - ho->value.data);
 
         } else {
+            return NGX_OK;
+        }
+
+        if (rc == NGX_DECLINED) {
             return NGX_OK;
         }
 


 




Copyright © Lexa Software, 1996-2009.