diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c index 0b388b30f..276cc0750 100644 --- a/src/http/modules/ngx_http_proxy_module.c +++ b/src/http/modules/ngx_http_proxy_module.c @@ -1752,6 +1752,10 @@ ngx_http_proxy_process_status_line(ngx_http_request_t *r) u = r->upstream; + if (r->state == 0) { + r->header_name_start = u->buffer.pos; + } + rc = ngx_http_parse_status_line(r, &u->buffer, &ctx->status); if (rc == NGX_AGAIN) { @@ -1759,6 +1763,7 @@ ngx_http_proxy_process_status_line(ngx_http_request_t *r) } if (rc == NGX_ERROR) { + u->buffer.pos = r->header_name_start; #if (NGX_HTTP_CACHE) diff --git a/src/http/modules/ngx_http_scgi_module.c b/src/http/modules/ngx_http_scgi_module.c index 290394a1f..b4a73a5a6 100644 --- a/src/http/modules/ngx_http_scgi_module.c +++ b/src/http/modules/ngx_http_scgi_module.c @@ -1028,6 +1028,10 @@ ngx_http_scgi_process_status_line(ngx_http_request_t *r) u = r->upstream; + if (r->state == 0) { + r->header_name_start = u->buffer.pos; + } + rc = ngx_http_parse_status_line(r, &u->buffer, status); if (rc == NGX_AGAIN) { @@ -1036,6 +1040,7 @@ ngx_http_scgi_process_status_line(ngx_http_request_t *r) if (rc == NGX_ERROR) { u->process_header = ngx_http_scgi_process_header; + u->buffer.pos = r->header_name_start; r->state = 0; return ngx_http_scgi_process_header(r); } diff --git a/src/http/modules/ngx_http_uwsgi_module.c b/src/http/modules/ngx_http_uwsgi_module.c index 4140b1b40..ecd6dd0d7 100644 --- a/src/http/modules/ngx_http_uwsgi_module.c +++ b/src/http/modules/ngx_http_uwsgi_module.c @@ -1267,6 +1267,10 @@ ngx_http_uwsgi_process_status_line(ngx_http_request_t *r) u = r->upstream; + if (r->state == 0) { + r->header_name_start = u->buffer.pos; + } + rc = ngx_http_parse_status_line(r, &u->buffer, status); if (rc == NGX_AGAIN) { @@ -1275,6 +1279,7 @@ ngx_http_uwsgi_process_status_line(ngx_http_request_t *r) if (rc == NGX_ERROR) { u->process_header = ngx_http_uwsgi_process_header; + u->buffer.pos = r->header_name_start; r->state = 0; return ngx_http_uwsgi_process_header(r); }