aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2006-09-25 17:49:49 +0000
committerIgor Sysoev <igor@sysoev.ru>2006-09-25 17:49:49 +0000
commit8a3cdc00ffea4ea4fbba2125771293352df6e1ae (patch)
tree36f3ce3b3bf68f8d3f4b2e27ec9046d6db47359c
parent586f7a5f5d2bad0202841f18f47f0cae4d229d35 (diff)
downloadnginx-8a3cdc00ffea4ea4fbba2125771293352df6e1ae.tar.gz
nginx-8a3cdc00ffea4ea4fbba2125771293352df6e1ae.zip
allowing handling 400 errors via proxy_pass
-rw-r--r--src/http/ngx_http_core_module.c11
-rw-r--r--src/http/ngx_http_request.c2
-rw-r--r--src/http/ngx_http_special_response.c4
3 files changed, 11 insertions, 6 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 8788deee5..fc24d904f 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -514,12 +514,7 @@ ngx_http_handler(ngx_http_request_t *r)
} 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 @@ ngx_http_handler(ngx_http_request_t *r)
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);
}
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 73eeeb07f..5ce2e2ae7 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -979,7 +979,7 @@ ngx_http_read_request_header(ngx_http_request_t *r)
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;
}
diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c
index 6658ed07c..8ddfce9c1 100644
--- a/src/http/ngx_http_special_response.c
+++ b/src/http/ngx_http_special_response.c
@@ -299,6 +299,9 @@ static ngx_str_t error_pages[] = {
};
+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 @@ ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error)
r->err_status = err_page[i].overwrite;
r->method = NGX_HTTP_GET;
+ r->method_name = ngx_http_get_name;
uri = &err_page[i].uri;