Mercurial > hg > nginx-mail
comparison src/http/modules/ngx_http_proxy_module.c @ 459:dac47e9ef0d5 NGINX_0_7_27
nginx 0.7.27
*) Feature: the "try_files" directive.
*) Feature: variables support in the "fastcgi_pass" directive.
*) Feature: now the $geo variable may get an address from a
variable.
Thanks to Andrei Nigmatulin.
*) Feature: now a location's modifier may be used without space before
name.
*) Feature: the $upstream_response_length variable.
*) Bugfix: now a "add_header" directive does not add an empty value.
*) Bugfix: if zero length static file was requested, then nginx just
closed connection; the bug had appeared in 0.7.25.
*) Bugfix: a MOVE method could not move file in non-existent directory.
*) Bugfix: a segmentation fault occurred in worker process, if no one
named location was defined in server, but some one was used in an
error_page directive.
Thanks to Sergey Bochenkov.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 15 Dec 2008 00:00:00 +0300 |
parents | b4f69f2ef02c |
children | 49a0eb7ce20c |
comparison
equal
deleted
inserted
replaced
458:3b8e9d1bc9bb | 459:dac47e9ef0d5 |
---|---|
30 } replacement; | 30 } replacement; |
31 }; | 31 }; |
32 | 32 |
33 | 33 |
34 typedef struct { | 34 typedef struct { |
35 ngx_str_t schema; | |
35 ngx_str_t host_header; | 36 ngx_str_t host_header; |
36 ngx_str_t port; | 37 ngx_str_t port; |
37 ngx_str_t uri; | 38 ngx_str_t uri; |
38 } ngx_http_proxy_vars_t; | 39 } ngx_http_proxy_vars_t; |
39 | 40 |
478 | 479 |
479 plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module); | 480 plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module); |
480 | 481 |
481 if (plcf->proxy_lengths == 0) { | 482 if (plcf->proxy_lengths == 0) { |
482 ctx->vars = plcf->vars; | 483 ctx->vars = plcf->vars; |
483 u->schema = plcf->upstream.schema; | 484 u->schema = plcf->vars.schema; |
484 #if (NGX_HTTP_SSL) | 485 #if (NGX_HTTP_SSL) |
485 u->ssl = (plcf->upstream.ssl != NULL); | 486 u->ssl = (plcf->upstream.ssl != NULL); |
486 #endif | 487 #endif |
487 | 488 |
488 } else { | 489 } else { |
1629 * | 1630 * |
1630 * conf->upstream.bufs.num = 0; | 1631 * conf->upstream.bufs.num = 0; |
1631 * conf->upstream.next_upstream = 0; | 1632 * conf->upstream.next_upstream = 0; |
1632 * conf->upstream.temp_path = NULL; | 1633 * conf->upstream.temp_path = NULL; |
1633 * conf->upstream.hide_headers_hash = { NULL, 0 }; | 1634 * conf->upstream.hide_headers_hash = { NULL, 0 }; |
1634 * conf->upstream.schema = { 0, NULL }; | |
1635 * conf->upstream.uri = { 0, NULL }; | 1635 * conf->upstream.uri = { 0, NULL }; |
1636 * conf->upstream.location = NULL; | 1636 * conf->upstream.location = NULL; |
1637 * conf->upstream.store_lengths = NULL; | 1637 * conf->upstream.store_lengths = NULL; |
1638 * conf->upstream.store_values = NULL; | 1638 * conf->upstream.store_values = NULL; |
1639 * | 1639 * |
1929 return NGX_CONF_ERROR; | 1929 return NGX_CONF_ERROR; |
1930 } | 1930 } |
1931 | 1931 |
1932 if (conf->upstream.upstream == NULL) { | 1932 if (conf->upstream.upstream == NULL) { |
1933 conf->upstream.upstream = prev->upstream.upstream; | 1933 conf->upstream.upstream = prev->upstream.upstream; |
1934 | |
1935 conf->vars = prev->vars; | 1934 conf->vars = prev->vars; |
1936 conf->upstream.schema = prev->upstream.schema; | |
1937 } | 1935 } |
1938 | 1936 |
1939 | 1937 |
1940 if (conf->body_source.data == NULL) { | 1938 if (conf->body_source.data == NULL) { |
1941 conf->body_source = prev->body_source; | 1939 conf->body_source = prev->body_source; |
2214 ngx_url_t u; | 2212 ngx_url_t u; |
2215 ngx_uint_t n; | 2213 ngx_uint_t n; |
2216 ngx_http_core_loc_conf_t *clcf; | 2214 ngx_http_core_loc_conf_t *clcf; |
2217 ngx_http_script_compile_t sc; | 2215 ngx_http_script_compile_t sc; |
2218 | 2216 |
2219 if (plcf->upstream.schema.len) { | 2217 if (plcf->upstream.upstream || plcf->proxy_lengths) { |
2220 return "is duplicate"; | 2218 return "is duplicate"; |
2221 } | 2219 } |
2222 | 2220 |
2223 clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); | 2221 clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); |
2224 | 2222 |
2294 | 2292 |
2295 if (ngx_http_proxy_set_vars(cf->pool, &u, &plcf->vars) != NGX_OK) { | 2293 if (ngx_http_proxy_set_vars(cf->pool, &u, &plcf->vars) != NGX_OK) { |
2296 return NGX_CONF_ERROR; | 2294 return NGX_CONF_ERROR; |
2297 } | 2295 } |
2298 | 2296 |
2299 plcf->upstream.schema.len = add; | 2297 plcf->vars.schema.len = add; |
2300 plcf->upstream.schema.data = url->data; | 2298 plcf->vars.schema.data = url->data; |
2301 plcf->location = clcf->name; | 2299 plcf->location = clcf->name; |
2302 | 2300 |
2303 clcf->handler = ngx_http_proxy_handler; | 2301 clcf->handler = ngx_http_proxy_handler; |
2304 | 2302 |
2305 if (clcf->named | 2303 if (clcf->named |