comparison src/http/modules/ngx_http_proxy_module.c @ 3323:9421e997c2c4

allow "proxy_pass http://$backend" without URI part
author Igor Sysoev <igor@sysoev.ru>
date Sun, 15 Nov 2009 11:36:12 +0000
parents fcd98af88df3
children bfe37ab335b5
comparison
equal deleted inserted replaced
3322:e19df6e65352 3323:9421e997c2c4
722 } 722 }
723 723
724 return NGX_ERROR; 724 return NGX_ERROR;
725 } 725 }
726 726
727 if (url.uri.len && url.uri.data[0] == '?') { 727 if (url.uri.len) {
728 p = ngx_pnalloc(r->pool, url.uri.len + 1); 728 if (url.uri.data[0] == '?') {
729 if (p == NULL) { 729 p = ngx_pnalloc(r->pool, url.uri.len + 1);
730 return NGX_ERROR; 730 if (p == NULL) {
731 } 731 return NGX_ERROR;
732 732 }
733 *p++ = '/'; 733
734 ngx_memcpy(p, url.uri.data, url.uri.len); 734 *p++ = '/';
735 735 ngx_memcpy(p, url.uri.data, url.uri.len);
736 url.uri.len++; 736
737 url.uri.data = p - 1; 737 url.uri.len++;
738 url.uri.data = p - 1;
739 }
740
741 } else {
742 url.uri = r->unparsed_uri;
738 } 743 }
739 744
740 ctx->vars.key_start = u->schema; 745 ctx->vars.key_start = u->schema;
741 746
742 ngx_http_proxy_set_vars(&url, &ctx->vars); 747 ngx_http_proxy_set_vars(&url, &ctx->vars);