Mercurial > hg > nginx
changeset 716:d8d7c39e3a76
allowing handling 400 errors via proxy_pass
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 25 Sep 2006 17:49:49 +0000 |
parents | cbd18f013385 |
children | 08652aae6fab |
files | src/http/ngx_http_core_module.c src/http/ngx_http_request.c src/http/ngx_http_special_response.c |
diffstat | 3 files changed, 12 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/ngx_http_core_module.c Mon Sep 25 17:48:34 2006 +0000 +++ b/src/http/ngx_http_core_module.c Mon Sep 25 17:49:49 2006 +0000 @@ -514,12 +514,7 @@ } else { r->lingering_close = 0; } - } - - r->valid_unparsed_uri = 1; - r->valid_location = 1; - - if (!r->internal) { + r->phase_handler = 0; } else { @@ -527,6 +522,12 @@ r->phase_handler = cmcf->phase_engine.server_rewrite_index; } + if (r->unparsed_uri.len) { + r->valid_unparsed_uri = 1; + } + + r->valid_location = 1; + r->write_event_handler = ngx_http_core_run_phases; ngx_http_core_run_phases(r); }
--- a/src/http/ngx_http_request.c Mon Sep 25 17:48:34 2006 +0000 +++ b/src/http/ngx_http_request.c Mon Sep 25 17:49:49 2006 +0000 @@ -979,7 +979,7 @@ c->error = rev->error; c->log->action = "sending response to client"; - ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST); + ngx_http_finalize_request(r, NGX_HTTP_CLIENT_CLOSED_REQUEST); return NGX_ERROR; }
--- a/src/http/ngx_http_special_response.c Mon Sep 25 17:48:34 2006 +0000 +++ b/src/http/ngx_http_special_response.c Mon Sep 25 17:49:49 2006 +0000 @@ -299,6 +299,9 @@ }; +static ngx_str_t ngx_http_get_name = { 3, "GET " }; + + ngx_int_t ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error) { @@ -364,6 +367,7 @@ r->err_status = err_page[i].overwrite; r->method = NGX_HTTP_GET; + r->method_name = ngx_http_get_name; uri = &err_page[i].uri;