Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.c @ 555:7bd37aef1e7e release-0.2.6
nginx-0.2.6-RELEASE import
*) Change: while using load-balancing the time before the failed
backend retry was decreased from 60 to 10 seconds.
*) Change: the "proxy_pass_unparsed_uri" was canceled, the original URI
now passed, if the URI part is omitted in "proxy_pass" directive.
*) Feature: the "error_page" directive supports redirects and allows
more flexible to change an error code.
*) Change: the charset in the "Content-Type" header line now is ignored
in proxied subrequests.
*) Bugfix: if the URI was changed in the "if" block and request did not
found new configuration, then the ngx_http_rewrite_module rules ran
again.
*) Bugfix: if the "set" directive set the ngx_http_geo_module variable
in some configuration part, the this variable was not available in
other configuration parts and the "using uninitialized variable"
error was occurred; the bug had appeared in 0.2.2.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 05 Oct 2005 14:46:21 +0000 |
parents | 45033d85b30e |
children | ecd9c160f25b |
comparison
equal
deleted
inserted
replaced
554:66e18ef48303 | 555:7bd37aef1e7e |
---|---|
624 | 624 |
625 if (!r->internal && clcf->internal) { | 625 if (!r->internal && clcf->internal) { |
626 return NGX_HTTP_NOT_FOUND; | 626 return NGX_HTTP_NOT_FOUND; |
627 } | 627 } |
628 | 628 |
629 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | |
630 "using configuration \"%s%V\"", | |
631 (clcf->noname ? "*" : (clcf->exact_match ? "=" : "")), | |
632 &clcf->name); | |
633 | |
629 ngx_http_update_location_config(r); | 634 ngx_http_update_location_config(r); |
630 | 635 |
631 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 636 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
632 "http cl:%z max:%uz", | 637 "http cl:%z max:%uz", |
633 r->headers_in.content_length_n, clcf->client_max_body_size); | 638 r->headers_in.content_length_n, clcf->client_max_body_size); |
706 { | 711 { |
707 ngx_int_t n, rc; | 712 ngx_int_t n, rc; |
708 ngx_uint_t i, found, noregex; | 713 ngx_uint_t i, found, noregex; |
709 ngx_http_core_loc_conf_t *clcf, **clcfp; | 714 ngx_http_core_loc_conf_t *clcf, **clcfp; |
710 | 715 |
711 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "find location"); | 716 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
717 "find location for \"%V\"", &r->uri); | |
712 | 718 |
713 found = 0; | 719 found = 0; |
714 noregex = 0; | 720 noregex = 0; |
715 | 721 |
716 clcfp = locations->elts; | 722 clcfp = locations->elts; |
905 | 911 |
906 | 912 |
907 ngx_int_t | 913 ngx_int_t |
908 ngx_http_send_header(ngx_http_request_t *r) | 914 ngx_http_send_header(ngx_http_request_t *r) |
909 { | 915 { |
910 if (r->err_ctx) { | 916 if (r->err_status) { |
911 r->headers_out.status = r->err_status; | 917 r->headers_out.status = r->err_status; |
912 r->headers_out.status_line.len = 0; | 918 r->headers_out.status_line.len = 0; |
913 } | 919 } |
914 | 920 |
915 return ngx_http_top_header_filter(r); | 921 return ngx_http_top_header_filter(r); |
2235 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | 2241 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
2236 "invalid value \"%V\"", &value[i]); | 2242 "invalid value \"%V\"", &value[i]); |
2237 return NGX_CONF_ERROR; | 2243 return NGX_CONF_ERROR; |
2238 } | 2244 } |
2239 | 2245 |
2240 overwrite = ngx_atoi(&value[i].data[1], value[i].len - 1); | 2246 if (value[i].len > 1) { |
2241 | 2247 overwrite = ngx_atoi(&value[i].data[1], value[i].len - 1); |
2242 if (overwrite == NGX_ERROR) { | 2248 |
2243 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | 2249 if (overwrite == NGX_ERROR) { |
2244 "invalid value \"%V\"", &value[i]); | 2250 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
2245 return NGX_CONF_ERROR; | 2251 "invalid value \"%V\"", &value[i]); |
2252 return NGX_CONF_ERROR; | |
2253 } | |
2254 | |
2255 } else { | |
2256 overwrite = 0; | |
2246 } | 2257 } |
2247 | 2258 |
2248 n = 2; | 2259 n = 2; |
2249 | 2260 |
2250 } else { | 2261 } else { |
2251 overwrite = 0; | 2262 overwrite = -1; |
2252 n = 1; | 2263 n = 1; |
2253 } | 2264 } |
2254 | 2265 |
2255 for (i = 1; i < cf->args->nelts - n; i++) { | 2266 for (i = 1; i < cf->args->nelts - n; i++) { |
2256 err = ngx_array_push(lcf->error_pages); | 2267 err = ngx_array_push(lcf->error_pages); |
2271 "value \"%V\" must be between 400 and 599", | 2282 "value \"%V\" must be between 400 and 599", |
2272 &value[i]); | 2283 &value[i]); |
2273 return NGX_CONF_ERROR; | 2284 return NGX_CONF_ERROR; |
2274 } | 2285 } |
2275 | 2286 |
2276 err->overwrite = overwrite; | 2287 err->overwrite = (overwrite >= 0) ? overwrite : err->status; |
2288 | |
2277 err->uri = value[cf->args->nelts - 1]; | 2289 err->uri = value[cf->args->nelts - 1]; |
2278 } | 2290 } |
2279 | 2291 |
2280 return NGX_CONF_OK; | 2292 return NGX_CONF_OK; |
2281 } | 2293 } |