Klaus Demo nginx / 8a3cdc0
allowing handling 400 errors via proxy_pass Igor Sysoev 15 years ago
3 changed file(s) with 12 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
513513 } else {
514514 r->lingering_close = 0;
515515 }
516 }
517
518 r->valid_unparsed_uri = 1;
519 r->valid_location = 1;
520
521 if (!r->internal) {
516
522517 r->phase_handler = 0;
523518
524519 } else {
525520 cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
526521 r->phase_handler = cmcf->phase_engine.server_rewrite_index;
527522 }
523
524 if (r->unparsed_uri.len) {
525 r->valid_unparsed_uri = 1;
526 }
527
528 r->valid_location = 1;
528529
529530 r->write_event_handler = ngx_http_core_run_phases;
530531 ngx_http_core_run_phases(r);
978978 c->error = rev->error;
979979 c->log->action = "sending response to client";
980980
981 ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
981 ngx_http_finalize_request(r, NGX_HTTP_CLIENT_CLOSED_REQUEST);
982982 return NGX_ERROR;
983983 }
984984
298298 };
299299
300300
301 static ngx_str_t ngx_http_get_name = { 3, "GET " };
302
303
301304 ngx_int_t
302305 ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error)
303306 {
363366 r->err_status = err_page[i].overwrite;
364367
365368 r->method = NGX_HTTP_GET;
369 r->method_name = ngx_http_get_name;
366370
367371 uri = &err_page[i].uri;
368372