comparison src/http/modules/ngx_http_proxy_module.c @ 158:2d15b82126ed NGINX_0_3_26

nginx 0.3.26 *) Change: the "optimize_host_names" directive was renamed to the "optimize_server_names". *) Bugfix: if in the "proxy_pass" directive was no the URI part, then the main request URI was transferred to a backend while proxying the SSI subrequest.
author Igor Sysoev <http://sysoev.ru>
date Fri, 03 Feb 2006 00:00:00 +0300
parents bb61aa162c6b
children 73e8476f9142
comparison
equal deleted inserted replaced
157:10bd259db2a7 158:2d15b82126ed
440 440
441 static ngx_int_t 441 static ngx_int_t
442 ngx_http_proxy_create_request(ngx_http_request_t *r) 442 ngx_http_proxy_create_request(ngx_http_request_t *r)
443 { 443 {
444 size_t len, loc_len, body_len; 444 size_t len, loc_len, body_len;
445 ngx_uint_t i, key; 445 ngx_uint_t i, key, unparsed_uri;
446 uintptr_t escape; 446 uintptr_t escape;
447 ngx_buf_t *b; 447 ngx_buf_t *b;
448 ngx_str_t *hh, method; 448 ngx_str_t *hh, method;
449 ngx_chain_t *cl, *body; 449 ngx_chain_t *cl, *body;
450 ngx_list_part_t *part; 450 ngx_list_part_t *part;
486 486
487 escape = 0; 487 escape = 0;
488 488
489 loc_len = r->valid_location ? u->conf->location.len : 0; 489 loc_len = r->valid_location ? u->conf->location.len : 0;
490 490
491 if (u->conf->uri.len == 0 && r->valid_unparsed_uri) { 491 if (u->conf->uri.len == 0 && r->valid_unparsed_uri && r == r->main) {
492 unparsed_uri = 1;
492 len += r->unparsed_uri.len; 493 len += r->unparsed_uri.len;
493 494
494 } else { 495 } else {
496 unparsed_uri = 0;
495 if (r->quoted_uri) { 497 if (r->quoted_uri) {
496 escape = 2 * ngx_escape_uri(NULL, r->uri.data + loc_len, 498 escape = 2 * ngx_escape_uri(NULL, r->uri.data + loc_len,
497 r->uri.len - loc_len, NGX_ESCAPE_URI); 499 r->uri.len - loc_len, NGX_ESCAPE_URI);
498 } 500 }
499 501
579 581
580 b->last = ngx_copy(b->last, method.data, method.len); 582 b->last = ngx_copy(b->last, method.data, method.len);
581 583
582 u->uri.data = b->last; 584 u->uri.data = b->last;
583 585
584 if (u->conf->uri.len == 0 && r->valid_unparsed_uri) { 586 if (unparsed_uri) {
585 b->last = ngx_copy(b->last, r->unparsed_uri.data, r->unparsed_uri.len); 587 b->last = ngx_copy(b->last, r->unparsed_uri.data, r->unparsed_uri.len);
586 588
587 } else { 589 } else {
588 if (r->valid_location) { 590 if (r->valid_location) {
589 b->last = ngx_copy(b->last, u->conf->uri.data, u->conf->uri.len); 591 b->last = ngx_copy(b->last, u->conf->uri.data, u->conf->uri.len);