ПРОЕКТЫ 


  АРХИВ 


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: ssl,post,proxy_set_body



Hello!

On Mon, Jun 27, 2011 at 01:20:51PM -0400, unlo wrote:

[...]

> proxy_pass         https://backend:443$uri$is_args$args;
> 
> proxy_set_body    "passwd=somepass&login_name=admin";
> 
> }
> 
> При этом, если бекенд доступен по
> протоколу http, всё проходит
> замечательно. А с https начинаются разные
> чудеса: post-запрос отрабатывает в 1
> случае из 100, в основном получаю 502.
> 
> С чем может быть связано такое
> поведение?
> Можно ли "подменять" тело запроса таким
> образом в ssl сессии?

Это ошибка, спасибо.  Патч прилагается.

Maxim Dounin
# HG changeset patch
# User Maxim Dounin <mdounin@xxxxxxxxxx>
# Date 1309213896 -14400
# Node ID cb597578355cbebcc44659cb7e0c9e4631e3c8b0
# Parent  1c167244d2fdb064c159012c50a7ae3fd1ed254a
Unbreak proxy_set_body and proxy_pass_request_body with ssl.

Flush flag wasn't set in constructed buffer and this prevented any data
from being actually sent to upstream due to ssl buffering.  Make sure
we always set flush in the last buffer we are going to sent.

See here for report:
http://nginx.org/pipermail/nginx-ru/2011-June/041552.html

diff --git a/src/http/modules/ngx_http_proxy_module.c 
b/src/http/modules/ngx_http_proxy_module.c
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -1130,12 +1130,11 @@ ngx_http_proxy_create_request(ngx_http_r
             body = body->next;
         }
 
-        b->flush = 1;
-
     } else {
         u->request_bufs = cl;
     }
 
+    b->flush = 1;
     cl->next = NULL;
 
     return NGX_OK;
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.