Welcome! Log In Create A New Profile

Advanced

Re: ssl,post,proxy_set_body

Maxim Dounin
June 27, 2011 06:34PM
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@mdounin.ru>
# 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@nginx.org
http://nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

ssl,post,proxy_set_body

unlo June 27, 2011 01:20PM

Re: ssl,post,proxy_set_body

Maxim Dounin June 27, 2011 06:34PM

Re: ssl,post,proxy_set_body

unlo June 28, 2011 03:52AM

Re: ssl,post,proxy_set_body

Igor Sysoev June 28, 2011 06:24AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 306
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready