Welcome! Log In Create A New Profile

Advanced

Nginx may recieve data from Upstream Server even a request has not sent

August 04, 2015 02:48AM
Hi,

I am using Nginx as reverse Proxy, during testing I have noticed
a situation Nginx receives response from upstream server even no request
has been sent yet from Nginx side.

The scenario is that the "Upstream Server" started to transfer data just
after
the connection has established without waiting to request from Nginx, Nginx
receives all the response
and does not send the Proxied request.

I have looked in the code and realized Nginx allows to receive response
even without request
*or* maybe the AND should be OR (* (!u->request_sent ||
ngx_http_upstream_test_connect(c) != NGX_OK))*

static void
ngx_http_upstream_process_header(ngx_http_request_t *r, ngx_http_upstream_t
*u)
{
ssize_t n;
ngx_int_t rc;
ngx_connection_t *c;

....





* if (!u->request_sent && ngx_http_upstream_test_connect(c) != NGX_OK)
{ ngx_http_upstream_next(r, u,
NGX_HTTP_UPSTREAM_FT_ERROR); return; }*


Please Advise
Thanks
Hagai Avrahami
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx may recieve data from Upstream Server even a request has not sent

hagaizzz August 04, 2015 02:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 100
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