comparison src/http/modules/ngx_http_proxy_module.c @ 416:b4f69f2ef02c NGINX_0_7_20

nginx 0.7.20 *) Changes in the ngx_http_gzip_filter_module. *) Feature: the ngx_http_limit_req_module. *) Bugfix: worker processes might exit on a SIGBUS signal on sparc and ppc platforms; the bug had appeared in 0.7.3. Thanks to Maxim Dounin. *) Bugfix: the "proxy_pass http://host/some:uri" directives did not work; the bug had appeared in 0.7.12. *) Bugfix: in HTTPS mode requests might fail with the "bad write retry" error. *) Bugfix: the ngx_http_secure_link_module did not work inside locations, whose names are less than 3 characters. *) Bugfix: $server_addr variable might have no value.
author Igor Sysoev <http://sysoev.ru>
date Mon, 10 Nov 2008 00:00:00 +0300
parents b246022ef454
children dac47e9ef0d5
comparison
equal deleted inserted replaced
415:5410f1e19796 416:b4f69f2ef02c
534 534
535 static ngx_int_t 535 static ngx_int_t
536 ngx_http_proxy_eval(ngx_http_request_t *r, ngx_http_proxy_ctx_t *ctx, 536 ngx_http_proxy_eval(ngx_http_request_t *r, ngx_http_proxy_ctx_t *ctx,
537 ngx_http_proxy_loc_conf_t *plcf) 537 ngx_http_proxy_loc_conf_t *plcf)
538 { 538 {
539 size_t add; 539 u_char *p;
540 u_short port; 540 size_t add;
541 ngx_str_t proxy; 541 u_short port;
542 ngx_url_t u; 542 ngx_str_t proxy;
543 ngx_url_t u;
543 544
544 if (ngx_http_script_run(r, &proxy, plcf->proxy_lengths->elts, 0, 545 if (ngx_http_script_run(r, &proxy, plcf->proxy_lengths->elts, 0,
545 plcf->proxy_values->elts) 546 plcf->proxy_values->elts)
546 == NULL) 547 == NULL)
547 { 548 {
587 } 588 }
588 589
589 return NGX_ERROR; 590 return NGX_ERROR;
590 } 591 }
591 592
593 if (u.uri.len && u.uri.data[0] == '?') {
594 p = ngx_pnalloc(r->pool, u.uri.len + 1);
595 if (p == NULL) {
596 return NGX_ERROR;
597 }
598
599 *p++ = '/';
600 ngx_memcpy(p, u.uri.data, u.uri.len);
601
602 u.uri.len++;
603 u.uri.data = p - 1;
604 }
605
592 if (ngx_http_proxy_set_vars(r->pool, &u, &ctx->vars) != NGX_OK) { 606 if (ngx_http_proxy_set_vars(r->pool, &u, &ctx->vars) != NGX_OK) {
593 return NGX_ERROR; 607 return NGX_ERROR;
594 } 608 }
595 609
596 r->upstream->resolved = ngx_pcalloc(r->pool, 610 r->upstream->resolved = ngx_pcalloc(r->pool,
600 } 614 }
601 615
602 r->upstream->resolved->host = u.host; 616 r->upstream->resolved->host = u.host;
603 r->upstream->resolved->port = (in_port_t) (u.no_port ? u.default_port: 617 r->upstream->resolved->port = (in_port_t) (u.no_port ? u.default_port:
604 u.port); 618 u.port);
605 r->upstream->resolved->default_port = u.default_port; 619 r->upstream->resolved->no_port = u.no_port;
606 620
607 return NGX_OK; 621 return NGX_OK;
608 } 622 }
609 623
610 624