ПРОЕКТЫ 


  АРХИВ 


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: Proxy error handling



On Thu, Feb 28, 2008 at 06:43:05PM +0300, Igor Sysoev wrote:

> On Thu, Feb 28, 2008 at 05:48:10PM +0300, Igor Shergin wrote:
> 
> > -            rewrite ^/test3(.*)$     /3.jpg;
> > -            rewrite ^/test2(.*)$     /2.jpg;
> > -            rewrite ^/test1(.*)$     /1.jpg;
> > -            return 200;
> > 
> > +            rewrite ^/test3(.*)$     /3.jpg  break;
> > +            rewrite ^/test2(.*)$     /2.jpg  break;
> > +            rewrite ^                /1.jpg  break;
> > 
> > Теперь выходит так:
> > 
> > igors@core0% telnet proxytest 80
> > Trying...
> > Connected to proxytest.
> > Escape character is '^]'.
> > GET /q HTTP/1.1
> > Host: proxytest
> > User-Agent: Test
> > 
> > Connection closed by foreign host.
> > 
> > Воспроизводится и на хосте с 0.5.33.
> 
> Прилагаемый патч должен решить проблему.

Предыдущий патч неправильный, его нужно откатить, а новый накатить.


-- 
Игорь Сысоев
http://sysoev.ru
Index: src/http/ngx_http_core_module.c
===================================================================
--- src/http/ngx_http_core_module.c     (revision 1223)
+++ src/http/ngx_http_core_module.c     (working copy)
@@ -1915,6 +1915,8 @@
         ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                        "named location: %V \"%V?%V\"", name, &r->uri, 
&r->args);
 
+        r->content_handler = NULL;
+
         r->internal = 1;
 
         r->loc_conf = clcfp[i]->loc_conf;
@@ -1924,6 +1926,7 @@
         cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
 
         r->phase_handler = cmcf->phase_engine.location_rewrite_index;
+
         ngx_http_core_run_phases(r);
 
         return NGX_DONE;


 




Copyright © Lexa Software, 1996-2009.